<commit_before>/*!
 * UtilityJS
 *
 * Copyright(c) 2016 <NAME>
 * MIT Licensed
 */

;(function(root, factory) {

  // For CommonJS-like enviroments (node.js)
  if (typeof module === 'object' && typeof module.exports === 'object') {

    module.exports = factory();

  // For AMD and browser
  } else {

    // Define the module globally in case of some libraries doesn't use AMD
    root.u = factory();

    // For AMD (requireJS)
    if (typeof define === 'function' && define.amd) {

      // Define an anonymous module
      define(function() {
        return factory();
      });

    }

  }
  
}(this, function() {

  /**
   * UtilityJS
   * 
   * @module u
   */

  var root      = this || global
    , previousU = root.u
    , u         = {};

  // The current version of the module
  u.VERSION = '0.1.3';

  ////////////////////////////////////////////////////
  // Methods > Variable Handeling ////////////////////
  ////////////////////////////////////////////////////

  /**
   * Check if a giving value is a number
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isNumber = function(value) {
    return !u.isNan(value) && toString.call(value) === '[object Number]';
  };
  
  /**
   * Check if a giving value is an object
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isObject = function(value) {
    return type === 'function' || (type === 'object' && !u.isNull(value));
  };

  /**
   * Check if a giving value is an array
   * 
   * @param  {*} value a value to be checked
   * @return {boolean}
   */
  u.isArray = Array.isArray || function(value) {
    return toString.call(value) === '[object Array]';
  };
  
  /**
   * Check if a giving value is a boolean
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isBoolean = function(value) {
    return value === true || value === false || toString.call(value) === '[object Boolean]';
  };

  /**
   * Check if a giving value is a null
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isNull = Number.isNaN || function(value) {
    return value === null;
  };

  /**
   * Check if a giving value is a date
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isDate = function(value) {
    return toString.call(value) === '[object Date]';
  };

  /**
   * Check if a giving value is an error
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isError = function(value) {
    return toString.call(value) === '[object Error]';
  };

  /**
   * Check if a giving value is an function
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isFunction = function(value) {
    return typeof value === 'function' || toString.call(value) === '[object Function]';
  };

  /**
   * Check if a giving value is a NaN
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isNan = function(value) {
    return value !== value;
  };

  /**
   * Check if a giving value is a undefined
   * 
   * @param  {*}  value a value to be check
   * @return {boolean}
   */
  u.isUndefined = function(value) {
    return typeof value === 'undefined';
  };

  ////////////////////////////////////////////////////
  // Methods > String ////////////////////////////////
  ////////////////////////////////////////////////////

  u.explode = function(delimiter, string, limit) {

    validateArguments([
      {
        type: 'string',
        required: true
      },
      {
        type: 'string',
        required: true
      },
      {
        type: 'number',
        required: false
      }
    ], delimiter, string, limit);

    // Params($delimiter, $string, $limit);

    // Throw new Error('Expect paramter 2 to be a string, array giving');

  };

  ////////////////////////////////////////////////////
  // Aliases /////////////////////////////////////////
  ////////////////////////////////////////////////////

  u.is_number   = u.isNumber;
  u.is_object   = u.isObject;
  u.is_array    = u.isArray;
  u.is_boolean  = u.isBoolean;
  u.is_null     = u.isNull;
  u.is_date     = u.isDate;
  u.is_error    = u.isError;
  u.is_function = u.isFunction;
  u.is_nan      = u.isNan;
  u.isNaN       = u.isNan;

  ////////////////////////////////////////////////////
  // Module //////////////////////////////////////////
  ////////////////////////////////////////////////////

  /**
   * Switch to "no conflict mode", set u to
   * the previously defined u and return the utilityJS module
   * 
   * @return {Object} utilityJS
   */
  u.noConflict = function() {
    root.u = previousU;
    return u;
  };<commit_msg>Improve comments for JSDoc<commit_after>/*!
 * UtilityJS
 *
 * Copyright(c) 2016 <NAME>
 * MIT Licensed
 */

;(function(root, factory) {

  // For CommonJS-like enviroments (node.js)
  if (typeof module === 'object' && typeof module.exports === 'object') {

    module.exports = factory();

  // For AMD and browser
  } else {

    // Define the module globally in case of some libraries doesn't use AMD
    root.u = factory();

    // For AMD (requireJS)
    if (typeof define === 'function' && define.amd) {

      // Define an anonymous module
      define(function() {
        return factory();
      });

    }

  }
  
}(this, function() {

  /**
   * UtilityJS
   * 
   * @module u
   */

  var root      = this || global
    , previousU = root.u
    , u         = {};

  // The current version of the module
  u.VERSION = '0.1.3';

  ////////////////////////////////////////////////////
  // Methods > Variable Handeling ////////////////////
  ////////////////////////////////////////////////////

  /**
   * Check if a giving value is a number
   *
   * @method isNumber
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  function isNumber(value) {
    return !u.isNan(value) && Object.prototype.toString.call(value) === '[object Number]';
  };
  
  /**
   * Check if a giving value is an object
   *
   * @method isObject
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  function isObject(value) {
    return type === 'function' || (type === 'object' && !u.isNull(value));
  };

  /**
   * Check if a giving value is an array
   *
   * @method isArray
   * @param  {*} value a value to be checked
   * @return {Boolean}
   */
  isArray = Array.isArray || function(value) {
    return Object.prototype.toString.call(value) === '[object Array]';
  };
  
  /**
   * Check if a giving value is a boolean
   *
   * @method isBoolean
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  function isBoolean(value) {
    return value === true || value === false || Object.prototype.toString.call(value) === '[object Boolean]';
  };

  /**
   * Check if a giving value is a null
   *
   * @method isNull
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  isNull = Number.isNaN || function(value) {
    return value === null;
  };

  /**
   * Check if a giving value is a date
   *
   * @method isDate
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  function isDate(value) {
    return Object.prototype.toString.call(value) === '[object Date]';
  };

  /**
   * Check if a giving value is an error
   *
   * @method isError
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  function isError(value) {
    return Object.prototype.toString.call(value) === '[object Error]';
  };

  /**
   * Check if a giving value is an function
   *
   * @method isFunction 
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  function isFunction(value) {
    return typeof value === 'function' || Object.prototype.toString.call(value) === '[object Function]';
  };

  /**
   * Check if a giving value is a NaN
   *
   * @method isNan
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  function isNan(value) {
    return value !== value;
  };

  /**
   * Check if a giving value is a undefined
   *
   * @method isUndefined 
   * @param  {*}  value a value to be check
   * @return {Boolean}
   */
  function isUndefined(value) {
    return typeof value === 'undefined';
  };

  ////////////////////////////////////////////////////
  // Methods > String ////////////////////////////////
  ////////////////////////////////////////////////////

  u.explode = function(delimiter, string, limit) {

    validateArguments([
      {
        type: 'string',
        required: true
      },
      {
        type: 'string',
        required: true
      },
      {
        type: 'number',
        required: false
      }
    ], delimiter, string, limit);

    // Params($delimiter, $string, $limit);

    // Throw new Error('Expect paramter 2 to be a string, array giving');

  };

  ////////////////////////////////////////////////////
  // Methods > String ////////////////////////////////
  ////////////////////////////////////////////////////

  u.is_number   = u.isNumber;
  u.is_object   = u.isObject;
  u.is_array    = u.isArray;
  u.is_boolean  = u.isBoolean;
  u.is_null     = u.isNull;
  u.is_date     = u.isDate;
  u.is_error    = u.isError;
  u.is_function = u.isFunction;
  u.is_nan      = u.isNan;
  u.isNaN       = u.isNan;

  ////////////////////////////////////////////////////
  // Module //////////////////////////////////////////
  ////////////////////////////////////////////////////

  /**
   * Switch to "no conflict mode", set u to
   * the previously defined u and return the utilityJS module
   * 
   * @return {Object} utilityJS
   */
  u.noConflict = function() {
    root.u = previousU;
    return u;
  };
{'fraction_non_alphanumeric': 0.24155683690280066, 'fraction_numerical': 0.0016474464579901153, 'mean_word_length': 1.5235126006755002, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '2832014', 'n_tokens_mistral': 2967, 'n_tokens_neox': 2862, 'n_words': 830}