diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2016-09-08 03:49:34 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2016-09-09 00:53:10 +0300 |
commit | 4727f8646daca7b3e3c1c95860e02acf583b9dae (patch) | |
tree | 289e58080f78cd2ec979167990b91c4d9f460e83 | |
parent | d88ec81ad33eb2268fcd517d35346a561bc59aff (diff) |
lodash.clonedeep@4.5.0
Credit: @jdalton
-rw-r--r-- | node_modules/lodash.clonedeep/README.md | 4 | ||||
-rw-r--r-- | node_modules/lodash.clonedeep/index.js | 193 | ||||
-rw-r--r-- | node_modules/lodash.clonedeep/package.json | 41 | ||||
-rw-r--r-- | package.json | 2 |
4 files changed, 84 insertions, 156 deletions
diff --git a/node_modules/lodash.clonedeep/README.md b/node_modules/lodash.clonedeep/README.md index 67634fe49..fee48e470 100644 --- a/node_modules/lodash.clonedeep/README.md +++ b/node_modules/lodash.clonedeep/README.md @@ -1,4 +1,4 @@ -# lodash.clonedeep v4.4.1 +# lodash.clonedeep v4.5.0 The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var cloneDeep = require('lodash.clonedeep'); ``` -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. diff --git a/node_modules/lodash.clonedeep/index.js b/node_modules/lodash.clonedeep/index.js index 75fba5e02..1b0e50298 100644 --- a/node_modules/lodash.clonedeep/index.js +++ b/node_modules/lodash.clonedeep/index.js @@ -48,7 +48,7 @@ var arrayBufferTag = '[object ArrayBuffer]', /** * 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). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; @@ -189,19 +189,6 @@ function arrayReduce(array, iteratee, accumulator, initAccum) { } /** - * 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 * or max array length checks. * @@ -269,7 +256,7 @@ function mapToArray(map) { } /** - * Creates a function that invokes `func` with its first argument transformed. + * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. @@ -301,6 +288,7 @@ function setToArray(set) { /** Used for built-in method references. */ var arrayProto = Array.prototype, + funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ @@ -313,14 +301,14 @@ var maskSrcKey = (function() { }()); /** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; +var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * 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. */ var objectToString = objectProto.toString; @@ -335,15 +323,15 @@ var reIsNative = RegExp('^' + var Buffer = moduleExports ? root.Buffer : undefined, Symbol = root.Symbol, Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice; /* 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); /* Built-in method references that are verified to be native. */ var DataView = getNative(root, 'DataView'), @@ -761,8 +749,35 @@ Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /** + * 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. * * @private @@ -782,7 +797,7 @@ function assignValue(object, key, value) { * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ @@ -924,23 +939,6 @@ function baseGetTag(value) { } /** - * 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. * * @private @@ -957,14 +955,24 @@ function baseIsNative(value) { } /** - * 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. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ -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; +} /** * Creates a clone of `buffer`. @@ -1145,19 +1153,6 @@ function getAllKeys(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) 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`. * * @private @@ -1186,15 +1181,6 @@ function getNative(object, key) { } /** - * 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`. * * @private @@ -1213,7 +1199,7 @@ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArra var getTag = baseGetTag; // 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) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || @@ -1319,23 +1305,6 @@ function initCloneByTag(object, tag, cloneFunc, isDeep) { } /** - * 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. * * @private @@ -1432,7 +1401,7 @@ function cloneDeep(value) { /** * 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. * * @static @@ -1485,7 +1454,7 @@ function eq(value, other) { * // => false */ 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') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); } @@ -1541,7 +1510,7 @@ var isArray = Array.isArray; * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } /** @@ -1611,8 +1580,7 @@ var isBuffer = nativeIsBuffer || stubFalse; */ function isFunction(value) { // 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) : ''; return tag == funcTag || tag == genTag; } @@ -1620,16 +1588,15 @@ function isFunction(value) { /** * 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 method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @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 * * _.isLength(3); @@ -1651,7 +1618,7 @@ function isLength(value) { /** * 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('')`) * * @static @@ -1708,32 +1675,10 @@ function isObjectLike(value) { } /** - * 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. * * @static @@ -1758,23 +1703,7 @@ function isString(value) { * // => ['0', '1'] */ 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); } /** diff --git a/node_modules/lodash.clonedeep/package.json b/node_modules/lodash.clonedeep/package.json index bc5f9af74..daac794cc 100644 --- a/node_modules/lodash.clonedeep/package.json +++ b/node_modules/lodash.clonedeep/package.json @@ -2,51 +2,50 @@ "_args": [ [ { - "raw": "lodash.clonedeep@4.4.1", + "raw": "lodash.clonedeep@4.5.0", "scope": null, "escapedName": "lodash.clonedeep", "name": "lodash.clonedeep", - "rawSpec": "4.4.1", - "spec": "4.4.1", + "rawSpec": "4.5.0", + "spec": "4.5.0", "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.clonedeep@4.4.1", - "_id": "lodash.clonedeep@4.4.1", + "_from": "lodash.clonedeep@4.5.0", + "_id": "lodash.clonedeep@4.5.0", "_inCache": true, - "_installable": true, "_location": "/lodash.clonedeep", - "_nodeVersion": "6.0.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.clonedeep-4.4.1.tgz_1469924456916_0.5767383889760822" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.clonedeep-4.5.0.tgz_1471109839710_0.7944763591513038" }, "_npmUser": { "name": "jdalton", "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.8", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "raw": "lodash.clonedeep@4.4.1", + "raw": "lodash.clonedeep@4.5.0", "scope": null, "escapedName": "lodash.clonedeep", "name": "lodash.clonedeep", - "rawSpec": "4.4.1", - "spec": "4.4.1", + "rawSpec": "4.5.0", + "spec": "4.5.0", "type": "version" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.4.1.tgz", - "_shasum": "8adb0621f7e69682af808fe8dbccaa2ba7a8b3ea", + "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "_shasum": "e23f3f9c4f8fbdde872529c1071857a086e5ccef", "_shrinkwrap": null, - "_spec": "lodash.clonedeep@4.4.1", - "_where": "/Users/rebecca/code/npm", + "_spec": "lodash.clonedeep@4.5.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "John-David Dalton", "email": "john.david.dalton@gmail.com", @@ -77,8 +76,8 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "8adb0621f7e69682af808fe8dbccaa2ba7a8b3ea", - "tarball": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.4.1.tgz" + "shasum": "e23f3f9c4f8fbdde872529c1071857a086e5ccef", + "tarball": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -111,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.4.1" + "version": "4.5.0" } diff --git a/package.json b/package.json index 15fd127c8..32f4fe017 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "init-package-json": "~1.9.4", "lockfile": "~1.0.1", "lodash._baseuniq": "~4.6.0", - "lodash.clonedeep": "~4.4.1", + "lodash.clonedeep": "~4.5.0", "lodash.union": "~4.5.0", "lodash.uniq": "~4.4.0", "lodash.without": "~4.3.0", |