<commit_before>/**
 * @module 101/equals
 */

/**
 * Functional version of ===
 * @function module:101/equals
 * @param {*} a - any value
 * @param {*} b - any value
 * @return {boolean} a === b
 */
module.exports = function (a, b) {
  if (arguments.length === 1) {
    return equals.bind(null, a);
  }
  else {
    return equals(a, b);
  }
};

function equals (a, b) {
  return a === b;
}<commit_msg>ES6 Object.is w/ MDN defined polyfill alternative<commit_after>/**
 * @module 101/equals
 */

/**
 * Functional version of ===
 * @function module:101/equals
 * @param {*} a - any value
 * @param {*} b - any value
 * @return {boolean} a === b
 */
module.exports = function (a, b) {
  if (arguments.length === 1) {
    return equals.bind(null, a);
  }
  else {
    return equals(a, b);
  }
};

function equals (v1, v2) {
  if (Object.is) {
    return Object.is(v1, v2);
  }
  else {
    // ES6 Object.is polyfill
    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
    if (v1 === 0 && v2 === 0) {
      return 1 / v1 === 1 / v2;
    }
    if (v1 !== v1) {
      return v2 !== v2;
    }
    return v1 === v2;
  }
}
{'fraction_non_alphanumeric': 0.1898188093183779, 'fraction_numerical': 0.029335634167385678, 'mean_word_length': 2.462686567164179, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '1809374', 'n_tokens_mistral': 448, 'n_tokens_neox': 425, 'n_words': 114}