<commit_before>/**
 * Determine whether two objects are conceptually equal
 * https://github.com/yr/is-equal
 * @copyright Yr
 * @license MIT
 */
export type DebugFn = (str: string, ...rest: Array<any>) => void;

/**
 * Determine if 'obj1' and 'obj2' are conceptually equal optionally ignoring properties in 'ignore'
 */
export function isEqual(obj1: any, obj2: any, ignore?: Array<string>, debug?: DebugFn): boolean {
  ignore = ignore || [];

  if (equal(obj1, obj2)) return true;

  if (isObject(obj1) && isObject(obj2)) {
    const keys1 = keys(obj1, ignore);
    const keys2 = keys(obj2, ignore);

    if (keys1.length != keys2.length) return false;

    for (let i = 0, n = keys1.length; i < n; i++) {
      const prop = keys1[i];
      const val1 = obj1[prop];
      const val2 = obj2[prop];

      if (!equal(val1, val2)) {
        if (debug) debug('"%s" not equal %s:%s', prop, val1, val2);
        return false;
      }<commit_msg>Use default parameter for ignore<commit_after>/**
 * Determine whether two objects are conceptually equal
 * https://github.com/yr/is-equal
 * @copyright Yr
 * @license MIT
 */
export type DebugFn = (str: string, ...rest: Array<any>) => void;

/**
 * Determine if 'obj1' and 'obj2' are conceptually equal optionally ignoring properties in 'ignore'
 */
export function isEqual(obj1: any, obj2: any, ignore: Array<string> = [], debug?: DebugFn): boolean {
  if (equal(obj1, obj2)) return true;

  if (isObject(obj1) && isObject(obj2)) {
    const keys1 = keys(obj1, ignore);
    const keys2 = keys(obj2, ignore);

    if (keys1.length != keys2.length) return false;

    for (let i = 0, n = keys1.length; i < n; i++) {
      const prop = keys1[i];
      const val1 = obj1[prop];
      const val2 = obj2[prop];

      if (!equal(val1, val2)) {
        if (debug) debug('"%s" not equal %s:%s', prop, val1, val2);
        return false;
      }
{'fraction_non_alphanumeric': 0.15646620542841938, 'fraction_numerical': 0.026609898882384245, 'mean_word_length': 3.2058165548098434, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '3654234', 'n_tokens_mistral': 635, 'n_tokens_neox': 618, 'n_words': 202}