lodash.clonedeep
Advanced tools
Comparing version 4.4.1 to 4.5.0
193
index.js
@@ -51,3 +51,3 @@ /** | ||
* Used to match `RegExp` | ||
* [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). | ||
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). | ||
*/ | ||
@@ -193,15 +193,2 @@ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; | ||
/** | ||
* The base implementation of `_.property` without support for deep paths. | ||
* | ||
* @private | ||
* @param {string} key The key of the property to get. | ||
* @returns {Function} Returns the new accessor function. | ||
*/ | ||
function baseProperty(key) { | ||
return function(object) { | ||
return object == null ? undefined : object[key]; | ||
}; | ||
} | ||
/** | ||
* The base implementation of `_.times` without support for iteratee shorthands | ||
@@ -274,3 +261,3 @@ * or max array length checks. | ||
/** | ||
* Creates a function that invokes `func` with its first argument transformed. | ||
* Creates a unary function that invokes `func` with its argument transformed. | ||
* | ||
@@ -307,2 +294,3 @@ * @private | ||
var arrayProto = Array.prototype, | ||
funcProto = Function.prototype, | ||
objectProto = Object.prototype; | ||
@@ -320,3 +308,3 @@ | ||
/** Used to resolve the decompiled source of functions. */ | ||
var funcToString = Function.prototype.toString; | ||
var funcToString = funcProto.toString; | ||
@@ -328,3 +316,3 @@ /** Used to check objects for own properties. */ | ||
* Used to resolve the | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) | ||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) | ||
* of values. | ||
@@ -344,2 +332,3 @@ */ | ||
Uint8Array = root.Uint8Array, | ||
getPrototype = overArg(Object.getPrototypeOf, Object), | ||
objectCreate = Object.create, | ||
@@ -350,6 +339,5 @@ propertyIsEnumerable = objectProto.propertyIsEnumerable, | ||
/* Built-in method references for those with the same name as other `lodash` methods. */ | ||
var nativeGetPrototype = Object.getPrototypeOf, | ||
nativeGetSymbols = Object.getOwnPropertySymbols, | ||
var nativeGetSymbols = Object.getOwnPropertySymbols, | ||
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, | ||
nativeKeys = Object.keys; | ||
nativeKeys = overArg(Object.keys, Object); | ||
@@ -772,4 +760,31 @@ /* Built-in method references that are verified to be native. */ | ||
/** | ||
* Creates an array of the enumerable property names of the array-like `value`. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @param {boolean} inherited Specify returning inherited property names. | ||
* @returns {Array} Returns the array of property names. | ||
*/ | ||
function arrayLikeKeys(value, inherited) { | ||
// Safari 8.1 makes `arguments.callee` enumerable in strict mode. | ||
// Safari 9 makes `arguments.length` enumerable in strict mode. | ||
var result = (isArray(value) || isArguments(value)) | ||
? baseTimes(value.length, String) | ||
: []; | ||
var length = result.length, | ||
skipIndexes = !!length; | ||
for (var key in value) { | ||
if ((inherited || hasOwnProperty.call(value, key)) && | ||
!(skipIndexes && (key == 'length' || isIndex(key, length)))) { | ||
result.push(key); | ||
} | ||
} | ||
return result; | ||
} | ||
/** | ||
* Assigns `value` to `key` of `object` if the existing value is not equivalent | ||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) | ||
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) | ||
* for equality comparisons. | ||
@@ -794,3 +809,3 @@ * | ||
* @private | ||
* @param {Array} array The array to search. | ||
* @param {Array} array The array to inspect. | ||
* @param {*} key The key to search for. | ||
@@ -937,19 +952,2 @@ * @returns {number} Returns the index of the matched value, else `-1`. | ||
/** | ||
* The base implementation of `_.has` without support for deep paths. | ||
* | ||
* @private | ||
* @param {Object} [object] The object to query. | ||
* @param {Array|string} key The key to check. | ||
* @returns {boolean} Returns `true` if `key` exists, else `false`. | ||
*/ | ||
function baseHas(object, key) { | ||
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, | ||
// that are composed entirely of index properties, return `false` for | ||
// `hasOwnProperty` checks of them. | ||
return object != null && | ||
(hasOwnProperty.call(object, key) || | ||
(typeof object == 'object' && key in object && getPrototype(object) === null)); | ||
} | ||
/** | ||
* The base implementation of `_.isNative` without bad shim checks. | ||
@@ -971,4 +969,3 @@ * | ||
/** | ||
* The base implementation of `_.keys` which doesn't skip the constructor | ||
* property of prototypes or treat sparse arrays as dense. | ||
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense. | ||
* | ||
@@ -979,3 +976,14 @@ * @private | ||
*/ | ||
var baseKeys = overArg(nativeKeys, Object); | ||
function baseKeys(object) { | ||
if (!isPrototype(object)) { | ||
return nativeKeys(object); | ||
} | ||
var result = []; | ||
for (var key in Object(object)) { | ||
if (hasOwnProperty.call(object, key) && key != 'constructor') { | ||
result.push(key); | ||
} | ||
} | ||
return result; | ||
} | ||
@@ -1161,15 +1169,2 @@ /** | ||
/** | ||
* 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) that affects | ||
* Safari on at least iOS 8.1-8.3 ARM64. | ||
* | ||
* @private | ||
* @param {Object} object The object to query. | ||
* @returns {*} Returns the "length" value. | ||
*/ | ||
var getLength = baseProperty('length'); | ||
/** | ||
* Gets the data for `map`. | ||
@@ -1203,11 +1198,2 @@ * | ||
/** | ||
* Gets the `[[Prototype]]` of `value`. | ||
* | ||
* @private | ||
* @param {*} value The value to query. | ||
* @returns {null|Object} Returns the `[[Prototype]]`. | ||
*/ | ||
var getPrototype = overArg(nativeGetPrototype, Object); | ||
/** | ||
* Creates an array of the own enumerable symbol properties of `object`. | ||
@@ -1231,3 +1217,3 @@ * | ||
// Fallback for data views, maps, sets, and weak maps in IE 11, | ||
// for data views in Edge, and promises in Node.js. | ||
// for data views in Edge < 14, and promises in Node.js. | ||
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || | ||
@@ -1338,19 +1324,2 @@ (Map && getTag(new Map) != mapTag) || | ||
/** | ||
* Creates an array of index keys for `object` values of arrays, | ||
* `arguments` objects, and strings, otherwise `null` is returned. | ||
* | ||
* @private | ||
* @param {Object} object The object to query. | ||
* @returns {Array|null} Returns index keys, else `null`. | ||
*/ | ||
function indexKeys(object) { | ||
var length = object ? object.length : undefined; | ||
if (isLength(length) && | ||
(isArray(object) || isString(object) || isArguments(object))) { | ||
return baseTimes(length, String); | ||
} | ||
return null; | ||
} | ||
/** | ||
* Checks if `value` is a valid array-like index. | ||
@@ -1452,3 +1421,3 @@ * | ||
* Performs a | ||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) | ||
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) | ||
* comparison between two values to determine if they are equivalent. | ||
@@ -1506,3 +1475,3 @@ * | ||
function isArguments(value) { | ||
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. | ||
// Safari 8.1 makes `arguments.callee` enumerable in strict mode. | ||
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && | ||
@@ -1563,3 +1532,3 @@ (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); | ||
function isArrayLike(value) { | ||
return value != null && isLength(getLength(value)) && !isFunction(value); | ||
return value != null && isLength(value.length) && !isFunction(value); | ||
} | ||
@@ -1634,4 +1603,3 @@ | ||
// The use of `Object#toString` avoids issues with the `typeof` operator | ||
// in Safari 8 which returns 'object' for typed array and weak map constructors, | ||
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances. | ||
// in Safari 8-9 which returns 'object' for typed array and other constructors. | ||
var tag = isObject(value) ? objectToString.call(value) : ''; | ||
@@ -1644,4 +1612,4 @@ return tag == funcTag || tag == genTag; | ||
* | ||
* **Note:** This function is loosely based on | ||
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). | ||
* **Note:** This method is loosely based on | ||
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). | ||
* | ||
@@ -1653,4 +1621,3 @@ * @static | ||
* @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 | ||
@@ -1677,3 +1644,3 @@ * | ||
* Checks if `value` is the | ||
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) | ||
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) | ||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) | ||
@@ -1735,28 +1702,6 @@ * | ||
/** | ||
* Checks if `value` is classified as a `String` primitive or object. | ||
* | ||
* @static | ||
* @since 0.1.0 | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is a string, else `false`. | ||
* @example | ||
* | ||
* _.isString('abc'); | ||
* // => true | ||
* | ||
* _.isString(1); | ||
* // => false | ||
*/ | ||
function isString(value) { | ||
return typeof value == 'string' || | ||
(!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); | ||
} | ||
/** | ||
* Creates an array of the own enumerable property names of `object`. | ||
* | ||
* **Note:** Non-object values are coerced to objects. See the | ||
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) | ||
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) | ||
* for more details. | ||
@@ -1786,19 +1731,3 @@ * | ||
function keys(object) { | ||
var isProto = isPrototype(object); | ||
if (!(isProto || isArrayLike(object))) { | ||
return baseKeys(object); | ||
} | ||
var indexes = indexKeys(object), | ||
skipIndexes = !!indexes, | ||
result = indexes || [], | ||
length = result.length; | ||
for (var key in object) { | ||
if (baseHas(object, key) && | ||
!(skipIndexes && (key == 'length' || isIndex(key, length))) && | ||
!(isProto && key == 'constructor')) { | ||
result.push(key); | ||
} | ||
} | ||
return result; | ||
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); | ||
} | ||
@@ -1805,0 +1734,0 @@ |
{ | ||
"name": "lodash.clonedeep", | ||
"version": "4.4.1", | ||
"version": "4.5.0", | ||
"description": "The lodash method `_.cloneDeep` exported as a module.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://lodash.com/", |
@@ -1,2 +0,2 @@ | ||
# lodash.clonedeep v4.4.1 | ||
# lodash.clonedeep v4.5.0 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.4.1-npm-packages/lodash.clonedeep) for more details. | ||
See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48202
1599