<commit_before>/*!
 * Module dependencies.
 */

var _ = require('lodash');
var util = require('util');

/*!
 * Expose sort of useful functions
 */
var Helper = {};

/*!
 * convert obj to string
 */
Helper.obj2str = function(val) {
  return Object.prototype.toString.call(val);
};

/*!
 * check if a value is empty
 */
Helper.isEmpty = function(val) {
  if (val === 0) return true;
  return !_.isNumber(val) && _.isEmpty(val);
};

/*!
 * check if a value is present
 */
Helper.isPresent = function(val) {
  return !Helper.isEmpty(val);
};

module.exports = Helper;<commit_msg>fix helpers.isEmpty(NaN) === false<commit_after>/*!
 * Module dependencies.
 */

var _ = require('lodash');
var util = require('util');

/*!
 * Expose sort of useful functions
 */
var Helper = {};

/*!
 * convert obj to string
 */
Helper.obj2str = function(val) {
  return Object.prototype.toString.call(val);
};

/*!
 * check if a value is empty
 */
Helper.isEmpty = function(val) {
  if (val === 0) return true;
  if (Number.isNaN(val)) return true;
  return !_.isNumber(val) && _.isEmpty(val);
};

/*!
 * check if a value is present
 */
Helper.isPresent = function(val) {
  return !Helper.isEmpty(val);
};

module.exports = Helper;
{'fraction_non_alphanumeric': 0.17700578990901572, 'fraction_numerical': 0.0033085194375516956, 'mean_word_length': 3.5833333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6365035', 'n_tokens_mistral': 404, 'n_tokens_neox': 398, 'n_words': 107}