Compare commits

...

3 Commits

Author SHA1 Message Date
John-David Dalton
826825a40a Bump to v4.5.5. 2019-07-09 21:54:46 -07:00
John-David Dalton
75c7a81c5c Bump to v4.5.4. 2019-07-09 21:54:45 -07:00
John-David Dalton
5338f5758c Bump to v4.5.3. 2019-07-09 21:54:45 -07:00
5 changed files with 278 additions and 149 deletions

View File

@@ -1,4 +1,4 @@
# lodash v4.5.2 # lodash v4.5.5
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.

View File

@@ -1,23 +1,47 @@
The MIT License (MIT) Copyright jQuery Foundation and other contributors <https://jquery.org/>
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> Based on Underscore.js, copyright Jeremy Ashkenas,
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining a copy This software consists of voluntary contributions made by many
of this software and associated documentation files (the "Software"), to deal individuals. For exact contribution history, see the revision history
in the Software without restriction, including without limitation the rights available at https://github.com/lodash/lodash
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The following license applies to all parts of this software except as
copies or substantial portions of the Software. documented below:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ====
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE Permission is hereby granted, free of charge, to any person obtaining
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER a copy of this software and associated documentation files (the
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, "Software"), to deal in the Software without restriction, including
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE without limitation the rights to use, copy, modify, merge, publish,
SOFTWARE. distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.

View File

@@ -1,4 +1,4 @@
# lodash._baseclone v4.5.2 # lodash._baseclone v4.5.5
The internal [lodash](https://lodash.com/) function `baseClone` exported as a [Node.js](https://nodejs.org/) module. The internal [lodash](https://lodash.com/) function `baseClone` exported as a [Node.js](https://nodejs.org/) module.
@@ -15,4 +15,4 @@ In Node.js:
var baseClone = require('lodash._baseclone'); var baseClone = require('lodash._baseclone');
``` ```
See the [package source](https://github.com/lodash/lodash/blob/4.5.2-npm-packages/lodash._baseclone) for more details. See the [package source](https://github.com/lodash/lodash/blob/4.5.5-npm-packages/lodash._baseclone) for more details.

View File

@@ -1,10 +1,10 @@
/** /**
* lodash 4.5.2 (Custom Build) <https://lodash.com/> * lodash 4.5.5 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./` * Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> * Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/ */
/** Used as the size to enable large array optimizations. */ /** Used as the size to enable large array optimizations. */
@@ -27,6 +27,7 @@ var argsTag = '[object Arguments]',
mapTag = '[object Map]', mapTag = '[object Map]',
numberTag = '[object Number]', numberTag = '[object Number]',
objectTag = '[object Object]', objectTag = '[object Object]',
promiseTag = '[object Promise]',
regexpTag = '[object RegExp]', regexpTag = '[object RegExp]',
setTag = '[object Set]', setTag = '[object Set]',
stringTag = '[object String]', stringTag = '[object String]',
@@ -34,6 +35,7 @@ var argsTag = '[object Arguments]',
weakMapTag = '[object WeakMap]'; weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]', var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]', float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]', float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]', int8Tag = '[object Int8Array]',
@@ -44,13 +46,16 @@ var arrayBufferTag = '[object ArrayBuffer]',
uint16Tag = '[object Uint16Array]', uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]'; uint32Tag = '[object Uint32Array]';
/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ /**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to match `RegExp` flags from their coerced string values. */ /** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/; var reFlags = /\w*$/;
/** Used to detect host constructors (Safari > 5). */ /** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect unsigned integer values. */ /** Used to detect unsigned integer values. */
@@ -59,16 +64,16 @@ var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to identify `toStringTag` values supported by `_.clone`. */ /** Used to identify `toStringTag` values supported by `_.clone`. */
var cloneableTags = {}; var cloneableTags = {};
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[argsTag] = cloneableTags[arrayTag] =
cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[boolTag] = cloneableTags[dateTag] =
cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] =
cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] =
cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[int32Tag] = cloneableTags[mapTag] =
cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[numberTag] = cloneableTags[objectTag] =
cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[regexpTag] = cloneableTags[setTag] =
cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[stringTag] = cloneableTags[symbolTag] =
cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
cloneableTags[uint32Tag] = true; cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[errorTag] = cloneableTags[funcTag] =
cloneableTags[weakMapTag] = false; cloneableTags[weakMapTag] = false;
@@ -163,6 +168,25 @@ function arrayEach(array, iteratee) {
return array; return array;
} }
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/** /**
* A specialized version of `_.reduce` for arrays without support for * A specialized version of `_.reduce` for arrays without support for
* iteratee shorthands. * iteratee shorthands.
@@ -171,7 +195,8 @@ function arrayEach(array, iteratee) {
* @param {Array} array The array to iterate over. * @param {Array} array The array to iterate over.
* @param {Function} iteratee The function invoked per iteration. * @param {Function} iteratee The function invoked per iteration.
* @param {*} [accumulator] The initial value. * @param {*} [accumulator] The initial value.
* @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as
* the initial value.
* @returns {*} Returns the accumulated value. * @returns {*} Returns the accumulated value.
*/ */
function arrayReduce(array, iteratee, accumulator, initAccum) { function arrayReduce(array, iteratee, accumulator, initAccum) {
@@ -295,7 +320,8 @@ var funcToString = Function.prototype.toString;
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
/** /**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var objectToString = objectProto.toString; var objectToString = objectProto.toString;
@@ -310,32 +336,36 @@ var reIsNative = RegExp('^' +
var Buffer = moduleExports ? root.Buffer : undefined, var Buffer = moduleExports ? root.Buffer : undefined,
Symbol = root.Symbol, Symbol = root.Symbol,
Uint8Array = root.Uint8Array, Uint8Array = root.Uint8Array,
getPrototypeOf = Object.getPrototypeOf,
getOwnPropertySymbols = Object.getOwnPropertySymbols, getOwnPropertySymbols = Object.getOwnPropertySymbols,
objectCreate = Object.create, objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable, propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = Object.keys; var nativeGetPrototype = Object.getPrototypeOf,
nativeKeys = Object.keys;
/* Built-in method references that are verified to be native. */ /* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map'), var DataView = getNative(root, 'DataView'),
Map = getNative(root, 'Map'),
Promise = getNative(root, 'Promise'),
Set = getNative(root, 'Set'), Set = getNative(root, 'Set'),
WeakMap = getNative(root, 'WeakMap'), WeakMap = getNative(root, 'WeakMap'),
nativeCreate = getNative(Object, 'create'); nativeCreate = getNative(Object, 'create');
/** Used to detect maps, sets, and weakmaps. */ /** Used to detect maps, sets, and weakmaps. */
var mapCtorString = Map ? funcToString.call(Map) : '', var dataViewCtorString = toSource(DataView),
setCtorString = Set ? funcToString.call(Set) : '', mapCtorString = toSource(Map),
weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/** Used to convert symbols to primitives and strings. */ /** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined, var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/** /**
* Creates an hash object. * Creates a hash object.
* *
* @private * @private
* @constructor * @constructor
@@ -395,6 +425,9 @@ function hashSet(hash, key, value) {
hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
} }
// Avoid inheriting from `Object.prototype` when possible.
Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
/** /**
* Creates a map cache object to store key-value pairs. * Creates a map cache object to store key-value pairs.
* *
@@ -487,7 +520,7 @@ function mapHas(key) {
* @memberOf MapCache * @memberOf MapCache
* @param {string} key The key of the value to set. * @param {string} key The key of the value to set.
* @param {*} value The value to set. * @param {*} value The value to set.
* @returns {Object} Returns the map cache object. * @returns {Object} Returns the map cache instance.
*/ */
function mapSet(key, value) { function mapSet(key, value) {
var data = this.__data__; var data = this.__data__;
@@ -501,6 +534,13 @@ function mapSet(key, value) {
return this; return this;
} }
// Add methods to `MapCache`.
MapCache.prototype.clear = mapClear;
MapCache.prototype['delete'] = mapDelete;
MapCache.prototype.get = mapGet;
MapCache.prototype.has = mapHas;
MapCache.prototype.set = mapSet;
/** /**
* Creates a stack cache object to store key-value pairs. * Creates a stack cache object to store key-value pairs.
* *
@@ -586,7 +626,7 @@ function stackHas(key) {
* @memberOf Stack * @memberOf Stack
* @param {string} key The key of the value to set. * @param {string} key The key of the value to set.
* @param {*} value The value to set. * @param {*} value The value to set.
* @returns {Object} Returns the stack cache object. * @returns {Object} Returns the stack cache instance.
*/ */
function stackSet(key, value) { function stackSet(key, value) {
var data = this.__data__, var data = this.__data__,
@@ -607,11 +647,18 @@ function stackSet(key, value) {
return this; return this;
} }
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
/** /**
* Removes `key` and its value from the associative array. * Removes `key` and its value from the associative array.
* *
* @private * @private
* @param {Array} array The array to query. * @param {Array} array The array to modify.
* @param {string} key The key of the value to remove. * @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/ */
@@ -655,8 +702,7 @@ function assocHas(array, key) {
} }
/** /**
* Gets the index at which the first occurrence of `key` is found in `array` * Gets the index at which the `key` is found in `array` of key-value pairs.
* of key-value pairs.
* *
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to search.
@@ -728,13 +774,14 @@ function baseAssign(object, source) {
* @private * @private
* @param {*} value The value to clone. * @param {*} value The value to clone.
* @param {boolean} [isDeep] Specify a deep clone. * @param {boolean} [isDeep] Specify a deep clone.
* @param {boolean} [isFull] Specify a clone including symbols.
* @param {Function} [customizer] The function to customize cloning. * @param {Function} [customizer] The function to customize cloning.
* @param {string} [key] The key of `value`. * @param {string} [key] The key of `value`.
* @param {Object} [object] The parent object of `value`. * @param {Object} [object] The parent object of `value`.
* @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
* @returns {*} Returns the cloned value. * @returns {*} Returns the cloned value.
*/ */
function baseClone(value, isDeep, customizer, key, object, stack) { function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
var result; var result;
if (customizer) { if (customizer) {
result = object ? customizer(value, key, object, stack) : customizer(value); result = object ? customizer(value, key, object, stack) : customizer(value);
@@ -770,7 +817,7 @@ function baseClone(value, isDeep, customizer, key, object, stack) {
if (!cloneableTags[tag]) { if (!cloneableTags[tag]) {
return object ? value : {}; return object ? value : {};
} }
result = initCloneByTag(value, tag, isDeep); result = initCloneByTag(value, tag, baseClone, isDeep);
} }
} }
// Check for circular references and return its corresponding clone. // Check for circular references and return its corresponding clone.
@@ -781,11 +828,18 @@ function baseClone(value, isDeep, customizer, key, object, stack) {
} }
stack.set(value, result); stack.set(value, result);
if (!isArr) {
var props = isFull ? getAllKeys(value) : keys(value);
}
// Recursively populate clone (susceptible to call stack limits). // Recursively populate clone (susceptible to call stack limits).
(isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { arrayEach(props || value, function(subValue, key) {
assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack)); if (props) {
key = subValue;
subValue = value[key];
}
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
}); });
return isArr ? result : copySymbols(value, result); return result;
} }
/** /**
@@ -801,29 +855,21 @@ function baseCreate(proto) {
} }
/** /**
* The base implementation of `baseForIn` and `baseForOwn` which iterates * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* over `object` properties returned by `keysFunc` invoking `iteratee` for * `keysFunc` and `symbolsFunc` to get the enumerable property names and
* each property. Iteratee functions may exit iteration early by explicitly * symbols of `object`.
* returning `false`.
* *
* @private * @private
* @param {Object} object The object to iterate over. * @param {Object} object The object to query.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/ */
var baseFor = createBaseFor(); function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
/** return isArray(object)
* The base implementation of `_.forOwn` without support for iteratee shorthands. ? result
* : arrayPush(result, symbolsFunc(object));
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns `object`.
*/
function baseForOwn(object, iteratee) {
return object && baseFor(object, iteratee, keys);
} }
/** /**
@@ -839,7 +885,7 @@ function baseHas(object, key) {
// that are composed entirely of index properties, return `false` for // that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them. // `hasOwnProperty` checks of them.
return hasOwnProperty.call(object, key) || return hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototypeOf(object) === null); (typeof object == 'object' && key in object && getPrototype(object) === null);
} }
/** /**
@@ -897,15 +943,31 @@ function cloneArrayBuffer(arrayBuffer) {
return result; return result;
} }
/**
* Creates a clone of `dataView`.
*
* @private
* @param {Object} dataView The data view to clone.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned data view.
*/
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
/** /**
* Creates a clone of `map`. * Creates a clone of `map`.
* *
* @private * @private
* @param {Object} map The map to clone. * @param {Object} map The map to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned map. * @returns {Object} Returns the cloned map.
*/ */
function cloneMap(map) { function cloneMap(map, isDeep, cloneFunc) {
return arrayReduce(mapToArray(map), addMapEntry, new map.constructor); var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
return arrayReduce(array, addMapEntry, new map.constructor);
} }
/** /**
@@ -926,10 +988,13 @@ function cloneRegExp(regexp) {
* *
* @private * @private
* @param {Object} set The set to clone. * @param {Object} set The set to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the cloned set. * @returns {Object} Returns the cloned set.
*/ */
function cloneSet(set) { function cloneSet(set, isDeep, cloneFunc) {
return arrayReduce(setToArray(set), addSetEntry, new set.constructor); var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
return arrayReduce(array, addSetEntry, new set.constructor);
} }
/** /**
@@ -980,7 +1045,7 @@ function copyArray(source, array) {
* *
* @private * @private
* @param {Object} source The object to copy properties from. * @param {Object} source The object to copy properties from.
* @param {Array} props The property names to copy. * @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to. * @param {Object} [object={}] The object to copy properties to.
* @returns {Object} Returns `object`. * @returns {Object} Returns `object`.
*/ */
@@ -994,7 +1059,7 @@ function copyObject(source, props, object) {
* *
* @private * @private
* @param {Object} source The object to copy properties from. * @param {Object} source The object to copy properties from.
* @param {Array} props The property names to copy. * @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The object to copy properties to. * @param {Object} [object={}] The object to copy properties to.
* @param {Function} [customizer] The function to customize copied values. * @param {Function} [customizer] The function to customize copied values.
* @returns {Object} Returns `object`. * @returns {Object} Returns `object`.
@@ -1030,34 +1095,22 @@ function copySymbols(source, object) {
} }
/** /**
* Creates a base function for methods like `_.forIn`. * Creates an array of own enumerable property names and symbols of `object`.
* *
* @private * @private
* @param {boolean} [fromRight] Specify iterating from right to left. * @param {Object} object The object to query.
* @returns {Function} Returns the new base function. * @returns {Array} Returns the array of property names and symbols.
*/ */
function createBaseFor(fromRight) { function getAllKeys(object) {
return function(object, iteratee, keysFunc) { return baseGetAllKeys(object, keys, getSymbols);
var index = -1,
iterable = Object(object),
props = keysFunc(object),
length = props.length;
while (length--) {
var key = props[fromRight ? length : ++index];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object;
};
} }
/** /**
* Gets the "length" property value of `object`. * Gets the "length" property value of `object`.
* *
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) * **Note:** This function is used to avoid a
* that affects Safari on at least iOS 8.1-8.3 ARM64. * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
* Safari on at least iOS 8.1-8.3 ARM64.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
@@ -1079,15 +1132,35 @@ function getNative(object, key) {
} }
/** /**
* Creates an array of the own symbol properties of `object`. * Gets the `[[Prototype]]` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {null|Object} Returns the `[[Prototype]]`.
*/
function getPrototype(value) {
return nativeGetPrototype(Object(value));
}
/**
* Creates an array of the own enumerable symbol properties of `object`.
* *
* @private * @private
* @param {Object} object The object to query. * @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols. * @returns {Array} Returns the array of symbols.
*/ */
var getSymbols = getOwnPropertySymbols || function() { function getSymbols(object) {
return []; // Coerce `object` to an object to avoid non-object errors in V8.
}; // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
return getOwnPropertySymbols(Object(object));
}
// Fallback for IE < 11.
if (!getOwnPropertySymbols) {
getSymbols = function() {
return [];
};
}
/** /**
* Gets the `toStringTag` of `value`. * Gets the `toStringTag` of `value`.
@@ -1100,18 +1173,23 @@ function getTag(value) {
return objectToString.call(value); return objectToString.call(value);
} }
// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. // Fallback for data views, maps, sets, and weak maps in IE 11,
if ((Map && getTag(new Map) != mapTag) || // for data views in Edge, and promises in Node.js.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) || (Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) { (WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) { getTag = function(value) {
var result = objectToString.call(value), var result = objectToString.call(value),
Ctor = result == objectTag ? value.constructor : null, Ctor = result == objectTag ? value.constructor : undefined,
ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; ctorString = Ctor ? toSource(Ctor) : undefined;
if (ctorString) { if (ctorString) {
switch (ctorString) { switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag; case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag; case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag; case weakMapCtorString: return weakMapTag;
} }
@@ -1148,7 +1226,7 @@ function initCloneArray(array) {
*/ */
function initCloneObject(object) { function initCloneObject(object) {
return (typeof object.constructor == 'function' && !isPrototype(object)) return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototypeOf(object)) ? baseCreate(getPrototype(object))
: {}; : {};
} }
@@ -1161,10 +1239,11 @@ function initCloneObject(object) {
* @private * @private
* @param {Object} object The object to clone. * @param {Object} object The object to clone.
* @param {string} tag The `toStringTag` of the object to clone. * @param {string} tag The `toStringTag` of the object to clone.
* @param {Function} cloneFunc The function to clone values.
* @param {boolean} [isDeep] Specify a deep clone. * @param {boolean} [isDeep] Specify a deep clone.
* @returns {Object} Returns the initialized clone. * @returns {Object} Returns the initialized clone.
*/ */
function initCloneByTag(object, tag, isDeep) { function initCloneByTag(object, tag, cloneFunc, isDeep) {
var Ctor = object.constructor; var Ctor = object.constructor;
switch (tag) { switch (tag) {
case arrayBufferTag: case arrayBufferTag:
@@ -1174,13 +1253,16 @@ function initCloneByTag(object, tag, isDeep) {
case dateTag: case dateTag:
return new Ctor(+object); return new Ctor(+object);
case dataViewTag:
return cloneDataView(object, isDeep);
case float32Tag: case float64Tag: case float32Tag: case float64Tag:
case int8Tag: case int16Tag: case int32Tag: case int8Tag: case int16Tag: case int32Tag:
case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep); return cloneTypedArray(object, isDeep);
case mapTag: case mapTag:
return cloneMap(object); return cloneMap(object, isDeep, cloneFunc);
case numberTag: case numberTag:
case stringTag: case stringTag:
@@ -1190,7 +1272,7 @@ function initCloneByTag(object, tag, isDeep) {
return cloneRegExp(object); return cloneRegExp(object);
case setTag: case setTag:
return cloneSet(object); return cloneSet(object, isDeep, cloneFunc);
case symbolTag: case symbolTag:
return cloneSymbol(object); return cloneSymbol(object);
@@ -1242,11 +1324,32 @@ function isPrototype(value) {
} }
/** /**
* Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) * Converts `func` to its source code.
*
* @private
* @param {Function} func The function to process.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent. * comparison between two values to determine if they are equivalent.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to compare. * @param {*} value The value to compare.
* @param {*} other The other value to compare. * @param {*} other The other value to compare.
@@ -1280,9 +1383,11 @@ function eq(value, other) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isArguments(function() { return arguments; }()); * _.isArguments(function() { return arguments; }());
@@ -1302,10 +1407,12 @@ function isArguments(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @type {Function} * @type {Function}
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isArray([1, 2, 3]); * _.isArray([1, 2, 3]);
@@ -1329,6 +1436,7 @@ var isArray = Array.isArray;
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
@@ -1356,9 +1464,11 @@ function isArrayLike(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. * @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example * @example
* *
* _.isArrayLikeObject([1, 2, 3]); * _.isArrayLikeObject([1, 2, 3]);
@@ -1382,6 +1492,7 @@ function isArrayLikeObject(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.3.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
@@ -1402,9 +1513,11 @@ var isBuffer = !Buffer ? constant(false) : function(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isFunction(_); * _.isFunction(_);
@@ -1424,13 +1537,16 @@ function isFunction(value) {
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *
* **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * **Note:** This function is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @returns {boolean} Returns `true` if `value` is a valid length,
* else `false`.
* @example * @example
* *
* _.isLength(3); * _.isLength(3);
@@ -1451,11 +1567,13 @@ function isLength(value) {
} }
/** /**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. * Checks if `value` is the
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 0.1.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
@@ -1484,6 +1602,7 @@ function isObject(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 4.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
@@ -1510,9 +1629,11 @@ function isObjectLike(value) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 3.0.0
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`. * @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
* @example * @example
* *
* _.isNative(Array.prototype.push); * _.isNative(Array.prototype.push);
@@ -1522,24 +1643,23 @@ function isObjectLike(value) {
* // => false * // => false
*/ */
function isNative(value) { function isNative(value) {
if (value == null) { if (!isObject(value)) {
return false; return false;
} }
if (isFunction(value)) { var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
return reIsNative.test(funcToString.call(value)); return pattern.test(toSource(value));
}
return isObjectLike(value) &&
(isHostObject(value) ? reIsNative : reIsHostCtor).test(value);
} }
/** /**
* Checks if `value` is classified as a `String` primitive or object. * Checks if `value` is classified as a `String` primitive or object.
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category Lang * @category Lang
* @param {*} value The value to check. * @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @returns {boolean} Returns `true` if `value` is correctly classified,
* else `false`.
* @example * @example
* *
* _.isString('abc'); * _.isString('abc');
@@ -1561,6 +1681,7 @@ function isString(value) {
* for more details. * for more details.
* *
* @static * @static
* @since 0.1.0
* @memberOf _ * @memberOf _
* @category Object * @category Object
* @param {Object} object The object to query. * @param {Object} object The object to query.
@@ -1605,6 +1726,7 @@ function keys(object) {
* *
* @static * @static
* @memberOf _ * @memberOf _
* @since 2.4.0
* @category Util * @category Util
* @param {*} value The value to return from the new function. * @param {*} value The value to return from the new function.
* @returns {Function} Returns the new function. * @returns {Function} Returns the new function.
@@ -1622,21 +1744,4 @@ function constant(value) {
}; };
} }
// Avoid inheriting from `Object.prototype` when possible.
Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto;
// Add functions to the `MapCache`.
MapCache.prototype.clear = mapClear;
MapCache.prototype['delete'] = mapDelete;
MapCache.prototype.get = mapGet;
MapCache.prototype.has = mapHas;
MapCache.prototype.set = mapSet;
// Add functions to the `Stack` cache.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = baseClone; module.exports = baseClone;

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash._baseclone", "name": "lodash._baseclone",
"version": "4.5.2", "version": "4.5.5",
"description": "The internal lodash function `baseClone` exported as a module.", "description": "The internal lodash function `baseClone` exported as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",