mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c2960211f |
@@ -1,4 +1,4 @@
|
||||
# lodash-amd v4.6.0
|
||||
# lodash-amd v4.6.1
|
||||
|
||||
The [lodash](https://lodash.com/) library exported as [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules.
|
||||
|
||||
@@ -27,4 +27,4 @@ require({
|
||||
});
|
||||
```
|
||||
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.6.0-amd) for more details.
|
||||
See the [package source](https://github.com/lodash/lodash/tree/4.6.1-amd) for more details.
|
||||
|
||||
@@ -54,13 +54,14 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_baseF
|
||||
* @private
|
||||
* @param {*} value The value to 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 {string} [key] The key of `value`.
|
||||
* @param {Object} [object] The parent object of `value`.
|
||||
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
|
||||
* @returns {*} Returns the cloned value.
|
||||
*/
|
||||
function baseClone(value, isDeep, customizer, key, object, stack) {
|
||||
function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
|
||||
var result;
|
||||
if (customizer) {
|
||||
result = object ? customizer(value, key, object, stack) : customizer(value);
|
||||
@@ -90,7 +91,8 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_baseF
|
||||
}
|
||||
result = initCloneObject(isFunc ? {} : value);
|
||||
if (!isDeep) {
|
||||
return copySymbols(value, baseAssign(result, value));
|
||||
result = baseAssign(result, value);
|
||||
return isFull ? copySymbols(value, result) : result;
|
||||
}
|
||||
} else {
|
||||
if (!cloneableTags[tag]) {
|
||||
@@ -109,9 +111,9 @@ define(['./_Stack', './_arrayEach', './_assignValue', './_baseAssign', './_baseF
|
||||
|
||||
// Recursively populate clone (susceptible to call stack limits).
|
||||
(isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
|
||||
assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack));
|
||||
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
|
||||
});
|
||||
return isArr ? result : copySymbols(value, result);
|
||||
return (isFull && !isArr) ? copySymbols(value, result) : result;
|
||||
}
|
||||
|
||||
return baseClone;
|
||||
|
||||
@@ -6,8 +6,11 @@ define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike',
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/** Built-in value references. */
|
||||
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||
|
||||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
||||
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf');
|
||||
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
|
||||
|
||||
/**
|
||||
* Assigns own enumerable properties of source objects to the destination
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
define(['./_assignValue', './_copyObject', './_createAssigner', './isArrayLike', './_isPrototype', './keysIn'], function(assignValue, copyObject, createAssigner, isArrayLike, isPrototype, keysIn) {
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Built-in value references. */
|
||||
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||
|
||||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
||||
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf');
|
||||
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
|
||||
|
||||
/**
|
||||
* This method is like `_.assign` except that it iterates over own and
|
||||
|
||||
2
clone.js
2
clone.js
@@ -25,7 +25,7 @@ define(['./_baseClone'], function(baseClone) {
|
||||
* // => true
|
||||
*/
|
||||
function clone(value) {
|
||||
return baseClone(value);
|
||||
return baseClone(value, false, true);
|
||||
}
|
||||
|
||||
return clone;
|
||||
|
||||
@@ -17,7 +17,7 @@ define(['./_baseClone'], function(baseClone) {
|
||||
* // => false
|
||||
*/
|
||||
function cloneDeep(value) {
|
||||
return baseClone(value, true);
|
||||
return baseClone(value, true, true);
|
||||
}
|
||||
|
||||
return cloneDeep;
|
||||
|
||||
@@ -27,7 +27,7 @@ define(['./_baseClone'], function(baseClone) {
|
||||
* // => 20
|
||||
*/
|
||||
function cloneDeepWith(value, customizer) {
|
||||
return baseClone(value, true, customizer);
|
||||
return baseClone(value, true, true, customizer);
|
||||
}
|
||||
|
||||
return cloneDeepWith;
|
||||
|
||||
@@ -30,7 +30,7 @@ define(['./_baseClone'], function(baseClone) {
|
||||
* // => 0
|
||||
*/
|
||||
function cloneWith(value, customizer) {
|
||||
return baseClone(value, false, customizer);
|
||||
return baseClone(value, false, true, customizer);
|
||||
}
|
||||
|
||||
return cloneWith;
|
||||
|
||||
24
main.js
24
main.js
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* lodash 4.6.0 (Custom Build) <https://lodash.com/>
|
||||
* lodash 4.6.1 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash exports="amd" -d -o ./main.js`
|
||||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
@@ -13,7 +13,7 @@
|
||||
var undefined;
|
||||
|
||||
/** Used as the semantic version number. */
|
||||
var VERSION = '4.6.0';
|
||||
var VERSION = '4.6.1';
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
@@ -1394,7 +1394,7 @@
|
||||
var metaMap = WeakMap && new WeakMap;
|
||||
|
||||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
||||
var nonEnumShadows = !({ 'valueOf': 1 }).propertyIsEnumerable('valueOf');
|
||||
var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');
|
||||
|
||||
/** Used to lookup unminified function names. */
|
||||
var realNames = {};
|
||||
@@ -2328,13 +2328,14 @@
|
||||
* @private
|
||||
* @param {*} value The value to 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 {string} [key] The key of `value`.
|
||||
* @param {Object} [object] The parent object of `value`.
|
||||
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
|
||||
* @returns {*} Returns the cloned value.
|
||||
*/
|
||||
function baseClone(value, isDeep, customizer, key, object, stack) {
|
||||
function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
|
||||
var result;
|
||||
if (customizer) {
|
||||
result = object ? customizer(value, key, object, stack) : customizer(value);
|
||||
@@ -2364,7 +2365,8 @@
|
||||
}
|
||||
result = initCloneObject(isFunc ? {} : value);
|
||||
if (!isDeep) {
|
||||
return copySymbols(value, baseAssign(result, value));
|
||||
result = baseAssign(result, value);
|
||||
return isFull ? copySymbols(value, result) : result;
|
||||
}
|
||||
} else {
|
||||
if (!cloneableTags[tag]) {
|
||||
@@ -2383,9 +2385,9 @@
|
||||
|
||||
// Recursively populate clone (susceptible to call stack limits).
|
||||
(isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
|
||||
assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack));
|
||||
assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
|
||||
});
|
||||
return isArr ? result : copySymbols(value, result);
|
||||
return (isFull && !isArr) ? copySymbols(value, result) : result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9467,7 +9469,7 @@
|
||||
* // => true
|
||||
*/
|
||||
function clone(value) {
|
||||
return baseClone(value);
|
||||
return baseClone(value, false, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9500,7 +9502,7 @@
|
||||
* // => 0
|
||||
*/
|
||||
function cloneWith(value, customizer) {
|
||||
return baseClone(value, false, customizer);
|
||||
return baseClone(value, false, true, customizer);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9520,7 +9522,7 @@
|
||||
* // => false
|
||||
*/
|
||||
function cloneDeep(value) {
|
||||
return baseClone(value, true);
|
||||
return baseClone(value, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9550,7 +9552,7 @@
|
||||
* // => 20
|
||||
*/
|
||||
function cloneDeepWith(value, customizer) {
|
||||
return baseClone(value, true, customizer);
|
||||
return baseClone(value, true, true, customizer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash-amd",
|
||||
"version": "4.6.0",
|
||||
"version": "4.6.1",
|
||||
"description": "Lodash exported as AMD modules.",
|
||||
"homepage": "https://lodash.com/custom-builds",
|
||||
"license": "MIT",
|
||||
|
||||
Reference in New Issue
Block a user