<commit_before>'use strict';

var isObject = require('is-plain-object');
var forOwn = require('for-own');
var omit = require('omit-keys');

module.exports = function omitDeep(value, props) {
  if (typeof value === 'undefined') {
    return {};
  }

  if (Array.isArray(value)) {
    for (var i = 0; i < value.length; i++) {
      value[i] = omitDeep(value[i], props);
    }
    return value;
  }

  if (!isObject(value)) {
    return value;
  }

  var o = {};
  forOwn(value, function(val, key) {
    o[key] = omitDeep(val, props);
  });

  return omit(o, props);<commit_msg>return value if `keys` isn't an array or string<commit_after>'use strict';

var isObject = require('is-plain-object');
var forOwn = require('for-own');
var omit = require('omit-keys');

module.exports = function omitDeep(value, keys) {
  if (typeof value === 'undefined') {
    return {};
  }

  if (Array.isArray(value)) {
    for (var i = 0; i < value.length; i++) {
      value[i] = omitDeep(value[i], keys);
    }
    return value;
  }

  if (!isObject(value)) {
    return value;
  }

  if (typeof keys === 'string') {
    keys = [keys];
  }

  if (!Array.isArray(keys)) {
    return value;
  }

  var o = {};
  forOwn(value, function (val, key) {
    o[key] = omitDeep(val, keys);
  });

  return omit(o, keys);
{'fraction_non_alphanumeric': 0.18343653250773995, 'fraction_numerical': 0.0015479876160990713, 'mean_word_length': 3.130990415335463, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1099006', 'n_tokens_mistral': 475, 'n_tokens_neox': 452, 'n_words': 116}