<commit_before>fs = require('fs')
_ = require('lodash')

# Check if valid path
#
# @private
#
# @param {String} path path
# @return {Boolean} is valid path
#
# @todo There should be more complex checks here
#
# @example Is valid path?
#		console.log isValidPath('/Users/me') # True
#		console.log isValidPath([ 1, 2, 3 ]) # False
#
exports.isValidPath = (p) ->
	return _.isString(p)

# Check if path is directory
#
# @private
#
# @param {String} directory directory
# @param {Function} callback callback(error, isDirectory)
#
# @example Is directory?
#		console.log isDirectory('/usr/local/share') # True
#		console.log isDirectory('/Users/me/app.js') # False
#
exports.isDirectory = (directory, callback) ->
	fs.stat directory, (error, stats) ->
		return callback?(error) if error?
		return callback?(null, stats.isDirectory())<commit_msg>Fix documentation examples for fsUtils.isDirectory<commit_after>fs = require('fs')
_ = require('lodash')

# Check if valid path
#
# @private
#
# @param {String} path path
# @return {Boolean} is valid path
#
# @todo There should be more complex checks here
#
# @example Is valid path?
#		console.log isValidPath('/Users/me') # True
#		console.log isValidPath([ 1, 2, 3 ]) # False
#
exports.isValidPath = (p) ->
	return _.isString(p)

# Check if path is directory
#
# @private
#
# @param {String} directory directory
# @param {Function} callback callback(error, isDirectory)
#
# @example Is directory?
#		isDirectory '/usr/local/share', (error, isDirectory) ->
#			throw error if error?
#			console.log(isDirectory)
#			# True
#
#		isDirectory '/Users/me/app.js', (error, isDirectory) ->
#			throw error if error?
#			console.log(isDirectory)
#			# False
#
exports.isDirectory = (directory, callback) ->
	fs.stat directory, (error, stats) ->
		return callback?(error) if error?
		return callback?(null, stats.isDirectory())
{'fraction_non_alphanumeric': 0.1493820526598603, 'fraction_numerical': 0.0032240730789897904, 'mean_word_length': 4.46041055718475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5381590', 'n_tokens_mistral': 633, 'n_tokens_neox': 620, 'n_words': 177}