mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a83b4ebd53 |
@@ -1,4 +1,4 @@
|
|||||||
# lodash-es v4.6.0
|
# lodash-es v4.6.1
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
|
The [lodash](https://lodash.com/) library exported as [ES](http://www.ecma-international.org/ecma-262/6.0/) modules.
|
||||||
|
|
||||||
@@ -7,4 +7,4 @@ Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
|
|||||||
$ lodash modularize exports=es -o ./
|
$ lodash modularize exports=es -o ./
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [package source](https://github.com/lodash/lodash/tree/4.6.0-es) for more details.
|
See the [package source](https://github.com/lodash/lodash/tree/4.6.1-es) for more details.
|
||||||
|
|||||||
@@ -66,13 +66,14 @@ cloneableTags[weakMapTag] = false;
|
|||||||
* @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);
|
||||||
@@ -102,7 +103,8 @@ function baseClone(value, isDeep, customizer, key, object, stack) {
|
|||||||
}
|
}
|
||||||
result = initCloneObject(isFunc ? {} : value);
|
result = initCloneObject(isFunc ? {} : value);
|
||||||
if (!isDeep) {
|
if (!isDeep) {
|
||||||
return copySymbols(value, baseAssign(result, value));
|
result = baseAssign(result, value);
|
||||||
|
return isFull ? copySymbols(value, result) : result;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!cloneableTags[tag]) {
|
if (!cloneableTags[tag]) {
|
||||||
@@ -121,9 +123,9 @@ function baseClone(value, isDeep, customizer, key, object, stack) {
|
|||||||
|
|
||||||
// Recursively populate clone (susceptible to call stack limits).
|
// Recursively populate clone (susceptible to call stack limits).
|
||||||
(isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
|
(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default baseClone;
|
export default baseClone;
|
||||||
|
|||||||
@@ -11,8 +11,11 @@ var objectProto = Object.prototype;
|
|||||||
/** Used to check objects for own properties. */
|
/** Used to check objects for own properties. */
|
||||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|
||||||
|
/** Built-in value references. */
|
||||||
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||||
|
|
||||||
/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */
|
/** 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
|
* Assigns own enumerable properties of source objects to the destination
|
||||||
|
|||||||
@@ -5,8 +5,14 @@ import isArrayLike from './isArrayLike';
|
|||||||
import isPrototype from './_isPrototype';
|
import isPrototype from './_isPrototype';
|
||||||
import keysIn from './keysIn';
|
import keysIn from './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. */
|
/** 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
|
* This method is like `_.assign` except that it iterates over own and
|
||||||
|
|||||||
2
clone.js
2
clone.js
@@ -25,7 +25,7 @@ import baseClone from './_baseClone';
|
|||||||
* // => true
|
* // => true
|
||||||
*/
|
*/
|
||||||
function clone(value) {
|
function clone(value) {
|
||||||
return baseClone(value);
|
return baseClone(value, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default clone;
|
export default clone;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import baseClone from './_baseClone';
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function cloneDeep(value) {
|
function cloneDeep(value) {
|
||||||
return baseClone(value, true);
|
return baseClone(value, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default cloneDeep;
|
export default cloneDeep;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import baseClone from './_baseClone';
|
|||||||
* // => 20
|
* // => 20
|
||||||
*/
|
*/
|
||||||
function cloneDeepWith(value, customizer) {
|
function cloneDeepWith(value, customizer) {
|
||||||
return baseClone(value, true, customizer);
|
return baseClone(value, true, true, customizer);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default cloneDeepWith;
|
export default cloneDeepWith;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import baseClone from './_baseClone';
|
|||||||
* // => 0
|
* // => 0
|
||||||
*/
|
*/
|
||||||
function cloneWith(value, customizer) {
|
function cloneWith(value, customizer) {
|
||||||
return baseClone(value, false, customizer);
|
return baseClone(value, false, true, customizer);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default cloneWith;
|
export default cloneWith;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* lodash 4.6.0 (Custom Build) <https://lodash.com/>
|
* lodash 4.6.1 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modularize exports="es" -o ./`
|
* Build: `lodash modularize exports="es" -o ./`
|
||||||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
@@ -44,7 +44,7 @@ import toInteger from './toInteger';
|
|||||||
import lodash from './wrapperLodash';
|
import lodash from './wrapperLodash';
|
||||||
|
|
||||||
/** Used as the semantic version number. */
|
/** Used as the semantic version number. */
|
||||||
var VERSION = '4.6.0';
|
var VERSION = '4.6.1';
|
||||||
|
|
||||||
/** Used to compose bitmasks for wrapper metadata. */
|
/** Used to compose bitmasks for wrapper metadata. */
|
||||||
var BIND_KEY_FLAG = 2;
|
var BIND_KEY_FLAG = 2;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* lodash 4.6.0 (Custom Build) <https://lodash.com/>
|
* lodash 4.6.1 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modularize exports="es" -o ./`
|
* Build: `lodash modularize exports="es" -o ./`
|
||||||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash-es",
|
"name": "lodash-es",
|
||||||
"version": "4.6.0",
|
"version": "4.6.1",
|
||||||
"description": "Lodash exported as ES modules.",
|
"description": "Lodash exported as ES modules.",
|
||||||
"homepage": "https://lodash.com/custom-builds",
|
"homepage": "https://lodash.com/custom-builds",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
Reference in New Issue
Block a user