"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/lodash._baseclone/index.js" (8 Mar 2017, 43306 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * lodash 4.5.3 (Custom Build) <https://lodash.com/>
    3  * Build: `lodash modularize exports="npm" -o ./`
    4  * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
    5  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
    6  * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
    7  * Available under MIT license <https://lodash.com/license>
    8  */
    9 
   10 /** Used as the size to enable large array optimizations. */
   11 var LARGE_ARRAY_SIZE = 200;
   12 
   13 /** Used to stand-in for `undefined` hash values. */
   14 var HASH_UNDEFINED = '__lodash_hash_undefined__';
   15 
   16 /** Used as references for various `Number` constants. */
   17 var MAX_SAFE_INTEGER = 9007199254740991;
   18 
   19 /** `Object#toString` result references. */
   20 var argsTag = '[object Arguments]',
   21     arrayTag = '[object Array]',
   22     boolTag = '[object Boolean]',
   23     dateTag = '[object Date]',
   24     errorTag = '[object Error]',
   25     funcTag = '[object Function]',
   26     genTag = '[object GeneratorFunction]',
   27     mapTag = '[object Map]',
   28     numberTag = '[object Number]',
   29     objectTag = '[object Object]',
   30     regexpTag = '[object RegExp]',
   31     setTag = '[object Set]',
   32     stringTag = '[object String]',
   33     symbolTag = '[object Symbol]',
   34     weakMapTag = '[object WeakMap]';
   35 
   36 var arrayBufferTag = '[object ArrayBuffer]',
   37     float32Tag = '[object Float32Array]',
   38     float64Tag = '[object Float64Array]',
   39     int8Tag = '[object Int8Array]',
   40     int16Tag = '[object Int16Array]',
   41     int32Tag = '[object Int32Array]',
   42     uint8Tag = '[object Uint8Array]',
   43     uint8ClampedTag = '[object Uint8ClampedArray]',
   44     uint16Tag = '[object Uint16Array]',
   45     uint32Tag = '[object Uint32Array]';
   46 
   47 /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */
   48 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
   49 
   50 /** Used to match `RegExp` flags from their coerced string values. */
   51 var reFlags = /\w*$/;
   52 
   53 /** Used to detect host constructors (Safari > 5). */
   54 var reIsHostCtor = /^\[object .+?Constructor\]$/;
   55 
   56 /** Used to detect unsigned integer values. */
   57 var reIsUint = /^(?:0|[1-9]\d*)$/;
   58 
   59 /** Used to identify `toStringTag` values supported by `_.clone`. */
   60 var cloneableTags = {};
   61 cloneableTags[argsTag] = cloneableTags[arrayTag] =
   62 cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
   63 cloneableTags[dateTag] = cloneableTags[float32Tag] =
   64 cloneableTags[float64Tag] = cloneableTags[int8Tag] =
   65 cloneableTags[int16Tag] = cloneableTags[int32Tag] =
   66 cloneableTags[mapTag] = cloneableTags[numberTag] =
   67 cloneableTags[objectTag] = cloneableTags[regexpTag] =
   68 cloneableTags[setTag] = cloneableTags[stringTag] =
   69 cloneableTags[symbolTag] = cloneableTags[uint8Tag] =
   70 cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] =
   71 cloneableTags[uint32Tag] = true;
   72 cloneableTags[errorTag] = cloneableTags[funcTag] =
   73 cloneableTags[weakMapTag] = false;
   74 
   75 /** Used to determine if values are of the language type `Object`. */
   76 var objectTypes = {
   77   'function': true,
   78   'object': true
   79 };
   80 
   81 /** Detect free variable `exports`. */
   82 var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
   83   ? exports
   84   : undefined;
   85 
   86 /** Detect free variable `module`. */
   87 var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
   88   ? module
   89   : undefined;
   90 
   91 /** Detect the popular CommonJS extension `module.exports`. */
   92 var moduleExports = (freeModule && freeModule.exports === freeExports)
   93   ? freeExports
   94   : undefined;
   95 
   96 /** Detect free variable `global` from Node.js. */
   97 var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
   98 
   99 /** Detect free variable `self`. */
  100 var freeSelf = checkGlobal(objectTypes[typeof self] && self);
  101 
  102 /** Detect free variable `window`. */
  103 var freeWindow = checkGlobal(objectTypes[typeof window] && window);
  104 
  105 /** Detect `this` as the global object. */
  106 var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
  107 
  108 /**
  109  * Used as a reference to the global object.
  110  *
  111  * The `this` value is used if it's the global object to avoid Greasemonkey's
  112  * restricted `window` object, otherwise the `window` object is used.
  113  */
  114 var root = freeGlobal ||
  115   ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
  116     freeSelf || thisGlobal || Function('return this')();
  117 
  118 /**
  119  * Adds the key-value `pair` to `map`.
  120  *
  121  * @private
  122  * @param {Object} map The map to modify.
  123  * @param {Array} pair The key-value pair to add.
  124  * @returns {Object} Returns `map`.
  125  */
  126 function addMapEntry(map, pair) {
  127   // Don't return `Map#set` because it doesn't return the map instance in IE 11.
  128   map.set(pair[0], pair[1]);
  129   return map;
  130 }
  131 
  132 /**
  133  * Adds `value` to `set`.
  134  *
  135  * @private
  136  * @param {Object} set The set to modify.
  137  * @param {*} value The value to add.
  138  * @returns {Object} Returns `set`.
  139  */
  140 function addSetEntry(set, value) {
  141   set.add(value);
  142   return set;
  143 }
  144 
  145 /**
  146  * A specialized version of `_.forEach` for arrays without support for
  147  * iteratee shorthands.
  148  *
  149  * @private
  150  * @param {Array} array The array to iterate over.
  151  * @param {Function} iteratee The function invoked per iteration.
  152  * @returns {Array} Returns `array`.
  153  */
  154 function arrayEach(array, iteratee) {
  155   var index = -1,
  156       length = array.length;
  157 
  158   while (++index < length) {
  159     if (iteratee(array[index], index, array) === false) {
  160       break;
  161     }
  162   }
  163   return array;
  164 }
  165 
  166 /**
  167  * A specialized version of `_.reduce` for arrays without support for
  168  * iteratee shorthands.
  169  *
  170  * @private
  171  * @param {Array} array The array to iterate over.
  172  * @param {Function} iteratee The function invoked per iteration.
  173  * @param {*} [accumulator] The initial value.
  174  * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value.
  175  * @returns {*} Returns the accumulated value.
  176  */
  177 function arrayReduce(array, iteratee, accumulator, initAccum) {
  178   var index = -1,
  179       length = array.length;
  180 
  181   if (initAccum && length) {
  182     accumulator = array[++index];
  183   }
  184   while (++index < length) {
  185     accumulator = iteratee(accumulator, array[index], index, array);
  186   }
  187   return accumulator;
  188 }
  189 
  190 /**
  191  * The base implementation of `_.times` without support for iteratee shorthands
  192  * or max array length checks.
  193  *
  194  * @private
  195  * @param {number} n The number of times to invoke `iteratee`.
  196  * @param {Function} iteratee The function invoked per iteration.
  197  * @returns {Array} Returns the array of results.
  198  */
  199 function baseTimes(n, iteratee) {
  200   var index = -1,
  201       result = Array(n);
  202 
  203   while (++index < n) {
  204     result[index] = iteratee(index);
  205   }
  206   return result;
  207 }
  208 
  209 /**
  210  * Checks if `value` is a global object.
  211  *
  212  * @private
  213  * @param {*} value The value to check.
  214  * @returns {null|Object} Returns `value` if it's a global object, else `null`.
  215  */
  216 function checkGlobal(value) {
  217   return (value && value.Object === Object) ? value : null;
  218 }
  219 
  220 /**
  221  * Checks if `value` is a host object in IE < 9.
  222  *
  223  * @private
  224  * @param {*} value The value to check.
  225  * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  226  */
  227 function isHostObject(value) {
  228   // Many host objects are `Object` objects that can coerce to strings
  229   // despite having improperly defined `toString` methods.
  230   var result = false;
  231   if (value != null && typeof value.toString != 'function') {
  232     try {
  233       result = !!(value + '');
  234     } catch (e) {}
  235   }
  236   return result;
  237 }
  238 
  239 /**
  240  * Checks if `value` is a valid array-like index.
  241  *
  242  * @private
  243  * @param {*} value The value to check.
  244  * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  245  * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  246  */
  247 function isIndex(value, length) {
  248   value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
  249   length = length == null ? MAX_SAFE_INTEGER : length;
  250   return value > -1 && value % 1 == 0 && value < length;
  251 }
  252 
  253 /**
  254  * Converts `map` to an array.
  255  *
  256  * @private
  257  * @param {Object} map The map to convert.
  258  * @returns {Array} Returns the converted array.
  259  */
  260 function mapToArray(map) {
  261   var index = -1,
  262       result = Array(map.size);
  263 
  264   map.forEach(function(value, key) {
  265     result[++index] = [key, value];
  266   });
  267   return result;
  268 }
  269 
  270 /**
  271  * Converts `set` to an array.
  272  *
  273  * @private
  274  * @param {Object} set The set to convert.
  275  * @returns {Array} Returns the converted array.
  276  */
  277 function setToArray(set) {
  278   var index = -1,
  279       result = Array(set.size);
  280 
  281   set.forEach(function(value) {
  282     result[++index] = value;
  283   });
  284   return result;
  285 }
  286 
  287 /** Used for built-in method references. */
  288 var arrayProto = Array.prototype,
  289     objectProto = Object.prototype;
  290 
  291 /** Used to resolve the decompiled source of functions. */
  292 var funcToString = Function.prototype.toString;
  293 
  294 /** Used to check objects for own properties. */
  295 var hasOwnProperty = objectProto.hasOwnProperty;
  296 
  297 /**
  298  * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
  299  * of values.
  300  */
  301 var objectToString = objectProto.toString;
  302 
  303 /** Used to detect if a method is native. */
  304 var reIsNative = RegExp('^' +
  305   funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  306   .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  307 );
  308 
  309 /** Built-in value references. */
  310 var Buffer = moduleExports ? root.Buffer : undefined,
  311     Symbol = root.Symbol,
  312     Uint8Array = root.Uint8Array,
  313     getPrototypeOf = Object.getPrototypeOf,
  314     getOwnPropertySymbols = Object.getOwnPropertySymbols,
  315     objectCreate = Object.create,
  316     propertyIsEnumerable = objectProto.propertyIsEnumerable,
  317     splice = arrayProto.splice;
  318 
  319 /* Built-in method references for those with the same name as other `lodash` methods. */
  320 var nativeKeys = Object.keys;
  321 
  322 /* Built-in method references that are verified to be native. */
  323 var Map = getNative(root, 'Map'),
  324     Set = getNative(root, 'Set'),
  325     WeakMap = getNative(root, 'WeakMap'),
  326     nativeCreate = getNative(Object, 'create');
  327 
  328 /** Used to detect maps, sets, and weakmaps. */
  329 var mapCtorString = Map ? funcToString.call(Map) : '',
  330     setCtorString = Set ? funcToString.call(Set) : '',
  331     weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';
  332 
  333 /** Used to convert symbols to primitives and strings. */
  334 var symbolProto = Symbol ? Symbol.prototype : undefined,
  335     symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  336 
  337 /**
  338  * Creates an hash object.
  339  *
  340  * @private
  341  * @constructor
  342  * @returns {Object} Returns the new hash object.
  343  */
  344 function Hash() {}
  345 
  346 /**
  347  * Removes `key` and its value from the hash.
  348  *
  349  * @private
  350  * @param {Object} hash The hash to modify.
  351  * @param {string} key The key of the value to remove.
  352  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  353  */
  354 function hashDelete(hash, key) {
  355   return hashHas(hash, key) && delete hash[key];
  356 }
  357 
  358 /**
  359  * Gets the hash value for `key`.
  360  *
  361  * @private
  362  * @param {Object} hash The hash to query.
  363  * @param {string} key The key of the value to get.
  364  * @returns {*} Returns the entry value.
  365  */
  366 function hashGet(hash, key) {
  367   if (nativeCreate) {
  368     var result = hash[key];
  369     return result === HASH_UNDEFINED ? undefined : result;
  370   }
  371   return hasOwnProperty.call(hash, key) ? hash[key] : undefined;
  372 }
  373 
  374 /**
  375  * Checks if a hash value for `key` exists.
  376  *
  377  * @private
  378  * @param {Object} hash The hash to query.
  379  * @param {string} key The key of the entry to check.
  380  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  381  */
  382 function hashHas(hash, key) {
  383   return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key);
  384 }
  385 
  386 /**
  387  * Sets the hash `key` to `value`.
  388  *
  389  * @private
  390  * @param {Object} hash The hash to modify.
  391  * @param {string} key The key of the value to set.
  392  * @param {*} value The value to set.
  393  */
  394 function hashSet(hash, key, value) {
  395   hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  396 }
  397 
  398 /**
  399  * Creates a map cache object to store key-value pairs.
  400  *
  401  * @private
  402  * @constructor
  403  * @param {Array} [values] The values to cache.
  404  */
  405 function MapCache(values) {
  406   var index = -1,
  407       length = values ? values.length : 0;
  408 
  409   this.clear();
  410   while (++index < length) {
  411     var entry = values[index];
  412     this.set(entry[0], entry[1]);
  413   }
  414 }
  415 
  416 /**
  417  * Removes all key-value entries from the map.
  418  *
  419  * @private
  420  * @name clear
  421  * @memberOf MapCache
  422  */
  423 function mapClear() {
  424   this.__data__ = {
  425     'hash': new Hash,
  426     'map': Map ? new Map : [],
  427     'string': new Hash
  428   };
  429 }
  430 
  431 /**
  432  * Removes `key` and its value from the map.
  433  *
  434  * @private
  435  * @name delete
  436  * @memberOf MapCache
  437  * @param {string} key The key of the value to remove.
  438  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  439  */
  440 function mapDelete(key) {
  441   var data = this.__data__;
  442   if (isKeyable(key)) {
  443     return hashDelete(typeof key == 'string' ? data.string : data.hash, key);
  444   }
  445   return Map ? data.map['delete'](key) : assocDelete(data.map, key);
  446 }
  447 
  448 /**
  449  * Gets the map value for `key`.
  450  *
  451  * @private
  452  * @name get
  453  * @memberOf MapCache
  454  * @param {string} key The key of the value to get.
  455  * @returns {*} Returns the entry value.
  456  */
  457 function mapGet(key) {
  458   var data = this.__data__;
  459   if (isKeyable(key)) {
  460     return hashGet(typeof key == 'string' ? data.string : data.hash, key);
  461   }
  462   return Map ? data.map.get(key) : assocGet(data.map, key);
  463 }
  464 
  465 /**
  466  * Checks if a map value for `key` exists.
  467  *
  468  * @private
  469  * @name has
  470  * @memberOf MapCache
  471  * @param {string} key The key of the entry to check.
  472  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  473  */
  474 function mapHas(key) {
  475   var data = this.__data__;
  476   if (isKeyable(key)) {
  477     return hashHas(typeof key == 'string' ? data.string : data.hash, key);
  478   }
  479   return Map ? data.map.has(key) : assocHas(data.map, key);
  480 }
  481 
  482 /**
  483  * Sets the map `key` to `value`.
  484  *
  485  * @private
  486  * @name set
  487  * @memberOf MapCache
  488  * @param {string} key The key of the value to set.
  489  * @param {*} value The value to set.
  490  * @returns {Object} Returns the map cache object.
  491  */
  492 function mapSet(key, value) {
  493   var data = this.__data__;
  494   if (isKeyable(key)) {
  495     hashSet(typeof key == 'string' ? data.string : data.hash, key, value);
  496   } else if (Map) {
  497     data.map.set(key, value);
  498   } else {
  499     assocSet(data.map, key, value);
  500   }
  501   return this;
  502 }
  503 
  504 /**
  505  * Creates a stack cache object to store key-value pairs.
  506  *
  507  * @private
  508  * @constructor
  509  * @param {Array} [values] The values to cache.
  510  */
  511 function Stack(values) {
  512   var index = -1,
  513       length = values ? values.length : 0;
  514 
  515   this.clear();
  516   while (++index < length) {
  517     var entry = values[index];
  518     this.set(entry[0], entry[1]);
  519   }
  520 }
  521 
  522 /**
  523  * Removes all key-value entries from the stack.
  524  *
  525  * @private
  526  * @name clear
  527  * @memberOf Stack
  528  */
  529 function stackClear() {
  530   this.__data__ = { 'array': [], 'map': null };
  531 }
  532 
  533 /**
  534  * Removes `key` and its value from the stack.
  535  *
  536  * @private
  537  * @name delete
  538  * @memberOf Stack
  539  * @param {string} key The key of the value to remove.
  540  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  541  */
  542 function stackDelete(key) {
  543   var data = this.__data__,
  544       array = data.array;
  545 
  546   return array ? assocDelete(array, key) : data.map['delete'](key);
  547 }
  548 
  549 /**
  550  * Gets the stack value for `key`.
  551  *
  552  * @private
  553  * @name get
  554  * @memberOf Stack
  555  * @param {string} key The key of the value to get.
  556  * @returns {*} Returns the entry value.
  557  */
  558 function stackGet(key) {
  559   var data = this.__data__,
  560       array = data.array;
  561 
  562   return array ? assocGet(array, key) : data.map.get(key);
  563 }
  564 
  565 /**
  566  * Checks if a stack value for `key` exists.
  567  *
  568  * @private
  569  * @name has
  570  * @memberOf Stack
  571  * @param {string} key The key of the entry to check.
  572  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  573  */
  574 function stackHas(key) {
  575   var data = this.__data__,
  576       array = data.array;
  577 
  578   return array ? assocHas(array, key) : data.map.has(key);
  579 }
  580 
  581 /**
  582  * Sets the stack `key` to `value`.
  583  *
  584  * @private
  585  * @name set
  586  * @memberOf Stack
  587  * @param {string} key The key of the value to set.
  588  * @param {*} value The value to set.
  589  * @returns {Object} Returns the stack cache object.
  590  */
  591 function stackSet(key, value) {
  592   var data = this.__data__,
  593       array = data.array;
  594 
  595   if (array) {
  596     if (array.length < (LARGE_ARRAY_SIZE - 1)) {
  597       assocSet(array, key, value);
  598     } else {
  599       data.array = null;
  600       data.map = new MapCache(array);
  601     }
  602   }
  603   var map = data.map;
  604   if (map) {
  605     map.set(key, value);
  606   }
  607   return this;
  608 }
  609 
  610 /**
  611  * Removes `key` and its value from the associative array.
  612  *
  613  * @private
  614  * @param {Array} array The array to query.
  615  * @param {string} key The key of the value to remove.
  616  * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  617  */
  618 function assocDelete(array, key) {
  619   var index = assocIndexOf(array, key);
  620   if (index < 0) {
  621     return false;
  622   }
  623   var lastIndex = array.length - 1;
  624   if (index == lastIndex) {
  625     array.pop();
  626   } else {
  627     splice.call(array, index, 1);
  628   }
  629   return true;
  630 }
  631 
  632 /**
  633  * Gets the associative array value for `key`.
  634  *
  635  * @private
  636  * @param {Array} array The array to query.
  637  * @param {string} key The key of the value to get.
  638  * @returns {*} Returns the entry value.
  639  */
  640 function assocGet(array, key) {
  641   var index = assocIndexOf(array, key);
  642   return index < 0 ? undefined : array[index][1];
  643 }
  644 
  645 /**
  646  * Checks if an associative array value for `key` exists.
  647  *
  648  * @private
  649  * @param {Array} array The array to query.
  650  * @param {string} key The key of the entry to check.
  651  * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  652  */
  653 function assocHas(array, key) {
  654   return assocIndexOf(array, key) > -1;
  655 }
  656 
  657 /**
  658  * Gets the index at which the first occurrence of `key` is found in `array`
  659  * of key-value pairs.
  660  *
  661  * @private
  662  * @param {Array} array The array to search.
  663  * @param {*} key The key to search for.
  664  * @returns {number} Returns the index of the matched value, else `-1`.
  665  */
  666 function assocIndexOf(array, key) {
  667   var length = array.length;
  668   while (length--) {
  669     if (eq(array[length][0], key)) {
  670       return length;
  671     }
  672   }
  673   return -1;
  674 }
  675 
  676 /**
  677  * Sets the associative array `key` to `value`.
  678  *
  679  * @private
  680  * @param {Array} array The array to modify.
  681  * @param {string} key The key of the value to set.
  682  * @param {*} value The value to set.
  683  */
  684 function assocSet(array, key, value) {
  685   var index = assocIndexOf(array, key);
  686   if (index < 0) {
  687     array.push([key, value]);
  688   } else {
  689     array[index][1] = value;
  690   }
  691 }
  692 
  693 /**
  694  * Assigns `value` to `key` of `object` if the existing value is not equivalent
  695  * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
  696  * for equality comparisons.
  697  *
  698  * @private
  699  * @param {Object} object The object to modify.
  700  * @param {string} key The key of the property to assign.
  701  * @param {*} value The value to assign.
  702  */
  703 function assignValue(object, key, value) {
  704   var objValue = object[key];
  705   if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  706       (value === undefined && !(key in object))) {
  707     object[key] = value;
  708   }
  709 }
  710 
  711 /**
  712  * The base implementation of `_.assign` without support for multiple sources
  713  * or `customizer` functions.
  714  *
  715  * @private
  716  * @param {Object} object The destination object.
  717  * @param {Object} source The source object.
  718  * @returns {Object} Returns `object`.
  719  */
  720 function baseAssign(object, source) {
  721   return object && copyObject(source, keys(source), object);
  722 }
  723 
  724 /**
  725  * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  726  * traversed objects.
  727  *
  728  * @private
  729  * @param {*} value The value to clone.
  730  * @param {boolean} [isDeep] Specify a deep clone.
  731  * @param {boolean} [isFull] Specify a clone including symbols.
  732  * @param {Function} [customizer] The function to customize cloning.
  733  * @param {string} [key] The key of `value`.
  734  * @param {Object} [object] The parent object of `value`.
  735  * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  736  * @returns {*} Returns the cloned value.
  737  */
  738 function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
  739   var result;
  740   if (customizer) {
  741     result = object ? customizer(value, key, object, stack) : customizer(value);
  742   }
  743   if (result !== undefined) {
  744     return result;
  745   }
  746   if (!isObject(value)) {
  747     return value;
  748   }
  749   var isArr = isArray(value);
  750   if (isArr) {
  751     result = initCloneArray(value);
  752     if (!isDeep) {
  753       return copyArray(value, result);
  754     }
  755   } else {
  756     var tag = getTag(value),
  757         isFunc = tag == funcTag || tag == genTag;
  758 
  759     if (isBuffer(value)) {
  760       return cloneBuffer(value, isDeep);
  761     }
  762     if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  763       if (isHostObject(value)) {
  764         return object ? value : {};
  765       }
  766       result = initCloneObject(isFunc ? {} : value);
  767       if (!isDeep) {
  768         result = baseAssign(result, value);
  769         return isFull ? copySymbols(value, result) : result;
  770       }
  771     } else {
  772       if (!cloneableTags[tag]) {
  773         return object ? value : {};
  774       }
  775       result = initCloneByTag(value, tag, isDeep);
  776     }
  777   }
  778   // Check for circular references and return its corresponding clone.
  779   stack || (stack = new Stack);
  780   var stacked = stack.get(value);
  781   if (stacked) {
  782     return stacked;
  783   }
  784   stack.set(value, result);
  785 
  786   // Recursively populate clone (susceptible to call stack limits).
  787   (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
  788     assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
  789   });
  790   return (isFull && !isArr) ? copySymbols(value, result) : result;
  791 }
  792 
  793 /**
  794  * The base implementation of `_.create` without support for assigning
  795  * properties to the created object.
  796  *
  797  * @private
  798  * @param {Object} prototype The object to inherit from.
  799  * @returns {Object} Returns the new object.
  800  */
  801 function baseCreate(proto) {
  802   return isObject(proto) ? objectCreate(proto) : {};
  803 }
  804 
  805 /**
  806  * The base implementation of `baseForIn` and `baseForOwn` which iterates
  807  * over `object` properties returned by `keysFunc` invoking `iteratee` for
  808  * each property. Iteratee functions may exit iteration early by explicitly
  809  * returning `false`.
  810  *
  811  * @private
  812  * @param {Object} object The object to iterate over.
  813  * @param {Function} iteratee The function invoked per iteration.
  814  * @param {Function} keysFunc The function to get the keys of `object`.
  815  * @returns {Object} Returns `object`.
  816  */
  817 var baseFor = createBaseFor();
  818 
  819 /**
  820  * The base implementation of `_.forOwn` without support for iteratee shorthands.
  821  *
  822  * @private
  823  * @param {Object} object The object to iterate over.
  824  * @param {Function} iteratee The function invoked per iteration.
  825  * @returns {Object} Returns `object`.
  826  */
  827 function baseForOwn(object, iteratee) {
  828   return object && baseFor(object, iteratee, keys);
  829 }
  830 
  831 /**
  832  * The base implementation of `_.has` without support for deep paths.
  833  *
  834  * @private
  835  * @param {Object} object The object to query.
  836  * @param {Array|string} key The key to check.
  837  * @returns {boolean} Returns `true` if `key` exists, else `false`.
  838  */
  839 function baseHas(object, key) {
  840   // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
  841   // that are composed entirely of index properties, return `false` for
  842   // `hasOwnProperty` checks of them.
  843   return hasOwnProperty.call(object, key) ||
  844     (typeof object == 'object' && key in object && getPrototypeOf(object) === null);
  845 }
  846 
  847 /**
  848  * The base implementation of `_.keys` which doesn't skip the constructor
  849  * property of prototypes or treat sparse arrays as dense.
  850  *
  851  * @private
  852  * @param {Object} object The object to query.
  853  * @returns {Array} Returns the array of property names.
  854  */
  855 function baseKeys(object) {
  856   return nativeKeys(Object(object));
  857 }
  858 
  859 /**
  860  * The base implementation of `_.property` without support for deep paths.
  861  *
  862  * @private
  863  * @param {string} key The key of the property to get.
  864  * @returns {Function} Returns the new function.
  865  */
  866 function baseProperty(key) {
  867   return function(object) {
  868     return object == null ? undefined : object[key];
  869   };
  870 }
  871 
  872 /**
  873  * Creates a clone of  `buffer`.
  874  *
  875  * @private
  876  * @param {Buffer} buffer The buffer to clone.
  877  * @param {boolean} [isDeep] Specify a deep clone.
  878  * @returns {Buffer} Returns the cloned buffer.
  879  */
  880 function cloneBuffer(buffer, isDeep) {
  881   if (isDeep) {
  882     return buffer.slice();
  883   }
  884   var result = new buffer.constructor(buffer.length);
  885   buffer.copy(result);
  886   return result;
  887 }
  888 
  889 /**
  890  * Creates a clone of `arrayBuffer`.
  891  *
  892  * @private
  893  * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  894  * @returns {ArrayBuffer} Returns the cloned array buffer.
  895  */
  896 function cloneArrayBuffer(arrayBuffer) {
  897   var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  898   new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  899   return result;
  900 }
  901 
  902 /**
  903  * Creates a clone of `map`.
  904  *
  905  * @private
  906  * @param {Object} map The map to clone.
  907  * @returns {Object} Returns the cloned map.
  908  */
  909 function cloneMap(map) {
  910   return arrayReduce(mapToArray(map), addMapEntry, new map.constructor);
  911 }
  912 
  913 /**
  914  * Creates a clone of `regexp`.
  915  *
  916  * @private
  917  * @param {Object} regexp The regexp to clone.
  918  * @returns {Object} Returns the cloned regexp.
  919  */
  920 function cloneRegExp(regexp) {
  921   var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  922   result.lastIndex = regexp.lastIndex;
  923   return result;
  924 }
  925 
  926 /**
  927  * Creates a clone of `set`.
  928  *
  929  * @private
  930  * @param {Object} set The set to clone.
  931  * @returns {Object} Returns the cloned set.
  932  */
  933 function cloneSet(set) {
  934   return arrayReduce(setToArray(set), addSetEntry, new set.constructor);
  935 }
  936 
  937 /**
  938  * Creates a clone of the `symbol` object.
  939  *
  940  * @private
  941  * @param {Object} symbol The symbol object to clone.
  942  * @returns {Object} Returns the cloned symbol object.
  943  */
  944 function cloneSymbol(symbol) {
  945   return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  946 }
  947 
  948 /**
  949  * Creates a clone of `typedArray`.
  950  *
  951  * @private
  952  * @param {Object} typedArray The typed array to clone.
  953  * @param {boolean} [isDeep] Specify a deep clone.
  954  * @returns {Object} Returns the cloned typed array.
  955  */
  956 function cloneTypedArray(typedArray, isDeep) {
  957   var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  958   return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  959 }
  960 
  961 /**
  962  * Copies the values of `source` to `array`.
  963  *
  964  * @private
  965  * @param {Array} source The array to copy values from.
  966  * @param {Array} [array=[]] The array to copy values to.
  967  * @returns {Array} Returns `array`.
  968  */
  969 function copyArray(source, array) {
  970   var index = -1,
  971       length = source.length;
  972 
  973   array || (array = Array(length));
  974   while (++index < length) {
  975     array[index] = source[index];
  976   }
  977   return array;
  978 }
  979 
  980 /**
  981  * Copies properties of `source` to `object`.
  982  *
  983  * @private
  984  * @param {Object} source The object to copy properties from.
  985  * @param {Array} props The property names to copy.
  986  * @param {Object} [object={}] The object to copy properties to.
  987  * @returns {Object} Returns `object`.
  988  */
  989 function copyObject(source, props, object) {
  990   return copyObjectWith(source, props, object);
  991 }
  992 
  993 /**
  994  * This function is like `copyObject` except that it accepts a function to
  995  * customize copied values.
  996  *
  997  * @private
  998  * @param {Object} source The object to copy properties from.
  999  * @param {Array} props The property names to copy.
 1000  * @param {Object} [object={}] The object to copy properties to.
 1001  * @param {Function} [customizer] The function to customize copied values.
 1002  * @returns {Object} Returns `object`.
 1003  */
 1004 function copyObjectWith(source, props, object, customizer) {
 1005   object || (object = {});
 1006 
 1007   var index = -1,
 1008       length = props.length;
 1009 
 1010   while (++index < length) {
 1011     var key = props[index];
 1012 
 1013     var newValue = customizer
 1014       ? customizer(object[key], source[key], key, object, source)
 1015       : source[key];
 1016 
 1017     assignValue(object, key, newValue);
 1018   }
 1019   return object;
 1020 }
 1021 
 1022 /**
 1023  * Copies own symbol properties of `source` to `object`.
 1024  *
 1025  * @private
 1026  * @param {Object} source The object to copy symbols from.
 1027  * @param {Object} [object={}] The object to copy symbols to.
 1028  * @returns {Object} Returns `object`.
 1029  */
 1030 function copySymbols(source, object) {
 1031   return copyObject(source, getSymbols(source), object);
 1032 }
 1033 
 1034 /**
 1035  * Creates a base function for methods like `_.forIn`.
 1036  *
 1037  * @private
 1038  * @param {boolean} [fromRight] Specify iterating from right to left.
 1039  * @returns {Function} Returns the new base function.
 1040  */
 1041 function createBaseFor(fromRight) {
 1042   return function(object, iteratee, keysFunc) {
 1043     var index = -1,
 1044         iterable = Object(object),
 1045         props = keysFunc(object),
 1046         length = props.length;
 1047 
 1048     while (length--) {
 1049       var key = props[fromRight ? length : ++index];
 1050       if (iteratee(iterable[key], key, iterable) === false) {
 1051         break;
 1052       }
 1053     }
 1054     return object;
 1055   };
 1056 }
 1057 
 1058 /**
 1059  * Gets the "length" property value of `object`.
 1060  *
 1061  * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
 1062  * that affects Safari on at least iOS 8.1-8.3 ARM64.
 1063  *
 1064  * @private
 1065  * @param {Object} object The object to query.
 1066  * @returns {*} Returns the "length" value.
 1067  */
 1068 var getLength = baseProperty('length');
 1069 
 1070 /**
 1071  * Gets the native function at `key` of `object`.
 1072  *
 1073  * @private
 1074  * @param {Object} object The object to query.
 1075  * @param {string} key The key of the method to get.
 1076  * @returns {*} Returns the function if it's native, else `undefined`.
 1077  */
 1078 function getNative(object, key) {
 1079   var value = object[key];
 1080   return isNative(value) ? value : undefined;
 1081 }
 1082 
 1083 /**
 1084  * Creates an array of the own symbol properties of `object`.
 1085  *
 1086  * @private
 1087  * @param {Object} object The object to query.
 1088  * @returns {Array} Returns the array of symbols.
 1089  */
 1090 var getSymbols = getOwnPropertySymbols || function() {
 1091   return [];
 1092 };
 1093 
 1094 /**
 1095  * Gets the `toStringTag` of `value`.
 1096  *
 1097  * @private
 1098  * @param {*} value The value to query.
 1099  * @returns {string} Returns the `toStringTag`.
 1100  */
 1101 function getTag(value) {
 1102   return objectToString.call(value);
 1103 }
 1104 
 1105 // Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps.
 1106 if ((Map && getTag(new Map) != mapTag) ||
 1107     (Set && getTag(new Set) != setTag) ||
 1108     (WeakMap && getTag(new WeakMap) != weakMapTag)) {
 1109   getTag = function(value) {
 1110     var result = objectToString.call(value),
 1111         Ctor = result == objectTag ? value.constructor : null,
 1112         ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';
 1113 
 1114     if (ctorString) {
 1115       switch (ctorString) {
 1116         case mapCtorString: return mapTag;
 1117         case setCtorString: return setTag;
 1118         case weakMapCtorString: return weakMapTag;
 1119       }
 1120     }
 1121     return result;
 1122   };
 1123 }
 1124 
 1125 /**
 1126  * Initializes an array clone.
 1127  *
 1128  * @private
 1129  * @param {Array} array The array to clone.
 1130  * @returns {Array} Returns the initialized clone.
 1131  */
 1132 function initCloneArray(array) {
 1133   var length = array.length,
 1134       result = array.constructor(length);
 1135 
 1136   // Add properties assigned by `RegExp#exec`.
 1137   if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
 1138     result.index = array.index;
 1139     result.input = array.input;
 1140   }
 1141   return result;
 1142 }
 1143 
 1144 /**
 1145  * Initializes an object clone.
 1146  *
 1147  * @private
 1148  * @param {Object} object The object to clone.
 1149  * @returns {Object} Returns the initialized clone.
 1150  */
 1151 function initCloneObject(object) {
 1152   return (typeof object.constructor == 'function' && !isPrototype(object))
 1153     ? baseCreate(getPrototypeOf(object))
 1154     : {};
 1155 }
 1156 
 1157 /**
 1158  * Initializes an object clone based on its `toStringTag`.
 1159  *
 1160  * **Note:** This function only supports cloning values with tags of
 1161  * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
 1162  *
 1163  * @private
 1164  * @param {Object} object The object to clone.
 1165  * @param {string} tag The `toStringTag` of the object to clone.
 1166  * @param {boolean} [isDeep] Specify a deep clone.
 1167  * @returns {Object} Returns the initialized clone.
 1168  */
 1169 function initCloneByTag(object, tag, isDeep) {
 1170   var Ctor = object.constructor;
 1171   switch (tag) {
 1172     case arrayBufferTag:
 1173       return cloneArrayBuffer(object);
 1174 
 1175     case boolTag:
 1176     case dateTag:
 1177       return new Ctor(+object);
 1178 
 1179     case float32Tag: case float64Tag:
 1180     case int8Tag: case int16Tag: case int32Tag:
 1181     case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
 1182       return cloneTypedArray(object, isDeep);
 1183 
 1184     case mapTag:
 1185       return cloneMap(object);
 1186 
 1187     case numberTag:
 1188     case stringTag:
 1189       return new Ctor(object);
 1190 
 1191     case regexpTag:
 1192       return cloneRegExp(object);
 1193 
 1194     case setTag:
 1195       return cloneSet(object);
 1196 
 1197     case symbolTag:
 1198       return cloneSymbol(object);
 1199   }
 1200 }
 1201 
 1202 /**
 1203  * Creates an array of index keys for `object` values of arrays,
 1204  * `arguments` objects, and strings, otherwise `null` is returned.
 1205  *
 1206  * @private
 1207  * @param {Object} object The object to query.
 1208  * @returns {Array|null} Returns index keys, else `null`.
 1209  */
 1210 function indexKeys(object) {
 1211   var length = object ? object.length : undefined;
 1212   if (isLength(length) &&
 1213       (isArray(object) || isString(object) || isArguments(object))) {
 1214     return baseTimes(length, String);
 1215   }
 1216   return null;
 1217 }
 1218 
 1219 /**
 1220  * Checks if `value` is suitable for use as unique object key.
 1221  *
 1222  * @private
 1223  * @param {*} value The value to check.
 1224  * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
 1225  */
 1226 function isKeyable(value) {
 1227   var type = typeof value;
 1228   return type == 'number' || type == 'boolean' ||
 1229     (type == 'string' && value != '__proto__') || value == null;
 1230 }
 1231 
 1232 /**
 1233  * Checks if `value` is likely a prototype object.
 1234  *
 1235  * @private
 1236  * @param {*} value The value to check.
 1237  * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
 1238  */
 1239 function isPrototype(value) {
 1240   var Ctor = value && value.constructor,
 1241       proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
 1242 
 1243   return value === proto;
 1244 }
 1245 
 1246 /**
 1247  * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
 1248  * comparison between two values to determine if they are equivalent.
 1249  *
 1250  * @static
 1251  * @memberOf _
 1252  * @category Lang
 1253  * @param {*} value The value to compare.
 1254  * @param {*} other The other value to compare.
 1255  * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 1256  * @example
 1257  *
 1258  * var object = { 'user': 'fred' };
 1259  * var other = { 'user': 'fred' };
 1260  *
 1261  * _.eq(object, object);
 1262  * // => true
 1263  *
 1264  * _.eq(object, other);
 1265  * // => false
 1266  *
 1267  * _.eq('a', 'a');
 1268  * // => true
 1269  *
 1270  * _.eq('a', Object('a'));
 1271  * // => false
 1272  *
 1273  * _.eq(NaN, NaN);
 1274  * // => true
 1275  */
 1276 function eq(value, other) {
 1277   return value === other || (value !== value && other !== other);
 1278 }
 1279 
 1280 /**
 1281  * Checks if `value` is likely an `arguments` object.
 1282  *
 1283  * @static
 1284  * @memberOf _
 1285  * @category Lang
 1286  * @param {*} value The value to check.
 1287  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
 1288  * @example
 1289  *
 1290  * _.isArguments(function() { return arguments; }());
 1291  * // => true
 1292  *
 1293  * _.isArguments([1, 2, 3]);
 1294  * // => false
 1295  */
 1296 function isArguments(value) {
 1297   // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
 1298   return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
 1299     (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
 1300 }
 1301 
 1302 /**
 1303  * Checks if `value` is classified as an `Array` object.
 1304  *
 1305  * @static
 1306  * @memberOf _
 1307  * @type {Function}
 1308  * @category Lang
 1309  * @param {*} value The value to check.
 1310  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
 1311  * @example
 1312  *
 1313  * _.isArray([1, 2, 3]);
 1314  * // => true
 1315  *
 1316  * _.isArray(document.body.children);
 1317  * // => false
 1318  *
 1319  * _.isArray('abc');
 1320  * // => false
 1321  *
 1322  * _.isArray(_.noop);
 1323  * // => false
 1324  */
 1325 var isArray = Array.isArray;
 1326 
 1327 /**
 1328  * Checks if `value` is array-like. A value is considered array-like if it's
 1329  * not a function and has a `value.length` that's an integer greater than or
 1330  * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
 1331  *
 1332  * @static
 1333  * @memberOf _
 1334  * @category Lang
 1335  * @param {*} value The value to check.
 1336  * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
 1337  * @example
 1338  *
 1339  * _.isArrayLike([1, 2, 3]);
 1340  * // => true
 1341  *
 1342  * _.isArrayLike(document.body.children);
 1343  * // => true
 1344  *
 1345  * _.isArrayLike('abc');
 1346  * // => true
 1347  *
 1348  * _.isArrayLike(_.noop);
 1349  * // => false
 1350  */
 1351 function isArrayLike(value) {
 1352   return value != null && isLength(getLength(value)) && !isFunction(value);
 1353 }
 1354 
 1355 /**
 1356  * This method is like `_.isArrayLike` except that it also checks if `value`
 1357  * is an object.
 1358  *
 1359  * @static
 1360  * @memberOf _
 1361  * @category Lang
 1362  * @param {*} value The value to check.
 1363  * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.
 1364  * @example
 1365  *
 1366  * _.isArrayLikeObject([1, 2, 3]);
 1367  * // => true
 1368  *
 1369  * _.isArrayLikeObject(document.body.children);
 1370  * // => true
 1371  *
 1372  * _.isArrayLikeObject('abc');
 1373  * // => false
 1374  *
 1375  * _.isArrayLikeObject(_.noop);
 1376  * // => false
 1377  */
 1378 function isArrayLikeObject(value) {
 1379   return isObjectLike(value) && isArrayLike(value);
 1380 }
 1381 
 1382 /**
 1383  * Checks if `value` is a buffer.
 1384  *
 1385  * @static
 1386  * @memberOf _
 1387  * @category Lang
 1388  * @param {*} value The value to check.
 1389  * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
 1390  * @example
 1391  *
 1392  * _.isBuffer(new Buffer(2));
 1393  * // => true
 1394  *
 1395  * _.isBuffer(new Uint8Array(2));
 1396  * // => false
 1397  */
 1398 var isBuffer = !Buffer ? constant(false) : function(value) {
 1399   return value instanceof Buffer;
 1400 };
 1401 
 1402 /**
 1403  * Checks if `value` is classified as a `Function` object.
 1404  *
 1405  * @static
 1406  * @memberOf _
 1407  * @category Lang
 1408  * @param {*} value The value to check.
 1409  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
 1410  * @example
 1411  *
 1412  * _.isFunction(_);
 1413  * // => true
 1414  *
 1415  * _.isFunction(/abc/);
 1416  * // => false
 1417  */
 1418 function isFunction(value) {
 1419   // The use of `Object#toString` avoids issues with the `typeof` operator
 1420   // in Safari 8 which returns 'object' for typed array and weak map constructors,
 1421   // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
 1422   var tag = isObject(value) ? objectToString.call(value) : '';
 1423   return tag == funcTag || tag == genTag;
 1424 }
 1425 
 1426 /**
 1427  * Checks if `value` is a valid array-like length.
 1428  *
 1429  * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
 1430  *
 1431  * @static
 1432  * @memberOf _
 1433  * @category Lang
 1434  * @param {*} value The value to check.
 1435  * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 1436  * @example
 1437  *
 1438  * _.isLength(3);
 1439  * // => true
 1440  *
 1441  * _.isLength(Number.MIN_VALUE);
 1442  * // => false
 1443  *
 1444  * _.isLength(Infinity);
 1445  * // => false
 1446  *
 1447  * _.isLength('3');
 1448  * // => false
 1449  */
 1450 function isLength(value) {
 1451   return typeof value == 'number' &&
 1452     value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
 1453 }
 1454 
 1455 /**
 1456  * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
 1457  * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 1458  *
 1459  * @static
 1460  * @memberOf _
 1461  * @category Lang
 1462  * @param {*} value The value to check.
 1463  * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 1464  * @example
 1465  *
 1466  * _.isObject({});
 1467  * // => true
 1468  *
 1469  * _.isObject([1, 2, 3]);
 1470  * // => true
 1471  *
 1472  * _.isObject(_.noop);
 1473  * // => true
 1474  *
 1475  * _.isObject(null);
 1476  * // => false
 1477  */
 1478 function isObject(value) {
 1479   var type = typeof value;
 1480   return !!value && (type == 'object' || type == 'function');
 1481 }
 1482 
 1483 /**
 1484  * Checks if `value` is object-like. A value is object-like if it's not `null`
 1485  * and has a `typeof` result of "object".
 1486  *
 1487  * @static
 1488  * @memberOf _
 1489  * @category Lang
 1490  * @param {*} value The value to check.
 1491  * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 1492  * @example
 1493  *
 1494  * _.isObjectLike({});
 1495  * // => true
 1496  *
 1497  * _.isObjectLike([1, 2, 3]);
 1498  * // => true
 1499  *
 1500  * _.isObjectLike(_.noop);
 1501  * // => false
 1502  *
 1503  * _.isObjectLike(null);
 1504  * // => false
 1505  */
 1506 function isObjectLike(value) {
 1507   return !!value && typeof value == 'object';
 1508 }
 1509 
 1510 /**
 1511  * Checks if `value` is a native function.
 1512  *
 1513  * @static
 1514  * @memberOf _
 1515  * @category Lang
 1516  * @param {*} value The value to check.
 1517  * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
 1518  * @example
 1519  *
 1520  * _.isNative(Array.prototype.push);
 1521  * // => true
 1522  *
 1523  * _.isNative(_);
 1524  * // => false
 1525  */
 1526 function isNative(value) {
 1527   if (value == null) {
 1528     return false;
 1529   }
 1530   if (isFunction(value)) {
 1531     return reIsNative.test(funcToString.call(value));
 1532   }
 1533   return isObjectLike(value) &&
 1534     (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
 1535 }
 1536 
 1537 /**
 1538  * Checks if `value` is classified as a `String` primitive or object.
 1539  *
 1540  * @static
 1541  * @memberOf _
 1542  * @category Lang
 1543  * @param {*} value The value to check.
 1544  * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
 1545  * @example
 1546  *
 1547  * _.isString('abc');
 1548  * // => true
 1549  *
 1550  * _.isString(1);
 1551  * // => false
 1552  */
 1553 function isString(value) {
 1554   return typeof value == 'string' ||
 1555     (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
 1556 }
 1557 
 1558 /**
 1559  * Creates an array of the own enumerable property names of `object`.
 1560  *
 1561  * **Note:** Non-object values are coerced to objects. See the
 1562  * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
 1563  * for more details.
 1564  *
 1565  * @static
 1566  * @memberOf _
 1567  * @category Object
 1568  * @param {Object} object The object to query.
 1569  * @returns {Array} Returns the array of property names.
 1570  * @example
 1571  *
 1572  * function Foo() {
 1573  *   this.a = 1;
 1574  *   this.b = 2;
 1575  * }
 1576  *
 1577  * Foo.prototype.c = 3;
 1578  *
 1579  * _.keys(new Foo);
 1580  * // => ['a', 'b'] (iteration order is not guaranteed)
 1581  *
 1582  * _.keys('hi');
 1583  * // => ['0', '1']
 1584  */
 1585 function keys(object) {
 1586   var isProto = isPrototype(object);
 1587   if (!(isProto || isArrayLike(object))) {
 1588     return baseKeys(object);
 1589   }
 1590   var indexes = indexKeys(object),
 1591       skipIndexes = !!indexes,
 1592       result = indexes || [],
 1593       length = result.length;
 1594 
 1595   for (var key in object) {
 1596     if (baseHas(object, key) &&
 1597         !(skipIndexes && (key == 'length' || isIndex(key, length))) &&
 1598         !(isProto && key == 'constructor')) {
 1599       result.push(key);
 1600     }
 1601   }
 1602   return result;
 1603 }
 1604 
 1605 /**
 1606  * Creates a function that returns `value`.
 1607  *
 1608  * @static
 1609  * @memberOf _
 1610  * @category Util
 1611  * @param {*} value The value to return from the new function.
 1612  * @returns {Function} Returns the new function.
 1613  * @example
 1614  *
 1615  * var object = { 'user': 'fred' };
 1616  * var getter = _.constant(object);
 1617  *
 1618  * getter() === object;
 1619  * // => true
 1620  */
 1621 function constant(value) {
 1622   return function() {
 1623     return value;
 1624   };
 1625 }
 1626 
 1627 // Avoid inheriting from `Object.prototype` when possible.
 1628 Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
 1629 
 1630 // Add functions to the `MapCache`.
 1631 MapCache.prototype.clear = mapClear;
 1632 MapCache.prototype['delete'] = mapDelete;
 1633 MapCache.prototype.get = mapGet;
 1634 MapCache.prototype.has = mapHas;
 1635 MapCache.prototype.set = mapSet;
 1636 
 1637 // Add functions to the `Stack` cache.
 1638 Stack.prototype.clear = stackClear;
 1639 Stack.prototype['delete'] = stackDelete;
 1640 Stack.prototype.get = stackGet;
 1641 Stack.prototype.has = stackHas;
 1642 Stack.prototype.set = stackSet;
 1643 
 1644 module.exports = baseClone;