<commit_before>import clone from "fast-clone";

export const isPromiseLike = function(promise): promise is Promise<any> {
  return promise && (<Promise<any>>promise).then !== undefined;
};

export var once = function(fn) {
  var done = false;
  var result;

  return function() {
    if (!done) {
      result = fn();
      done = true;
    }

    return result;
  };
};

export const findInArray = function(
  values: any[],
  predicate: (value, key, values) => any
) {
  let idx = 0;
  for (const value of values) {
    const result = predicate(value, idx, values);
    if (result) {
      return result;
    }

    idx++;
  }
};

const isObjectLike = function(value) {
  return value != null && typeof value == "object";
};

export const cloneDeep = function(value) {
  return clone(value);
};<commit_msg>[FEATURE] Remove obsolete isObjectLike util<commit_after>import clone from "fast-clone";

export const isPromiseLike = function(promise): promise is Promise<any> {
  return promise && (<Promise<any>>promise).then !== undefined;
};

export var once = function(fn) {
  var done = false;
  var result;

  return function() {
    if (!done) {
      result = fn();
      done = true;
    }

    return result;
  };
};

export const findInArray = function(
  values: any[],
  predicate: (value, key, values) => any
) {
  let idx = 0;
  for (const value of values) {
    const result = predicate(value, idx, values);
    if (result) {
      return result;
    }

    idx++;
  }
};

export const cloneDeep = function(value) {
  return clone(value);
};
{'fraction_non_alphanumeric': 0.14119922630560927, 'fraction_numerical': 0.0012894906511927789, 'mean_word_length': 3.183288409703504, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5177875', 'n_tokens_mistral': 497, 'n_tokens_neox': 485, 'n_words': 151}