mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6778141728 |
@@ -1,4 +1,4 @@
|
|||||||
# lodash-es v4.16.3
|
# lodash-es v4.16.4
|
||||||
|
|
||||||
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.16.3-es) for more details.
|
See the [package source](https://github.com/lodash/lodash/tree/4.16.4-es) for more details.
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import baseTimes from './_baseTimes.js';
|
import baseTimes from './_baseTimes.js';
|
||||||
import isArguments from './isArguments.js';
|
import isArguments from './isArguments.js';
|
||||||
import isArray from './isArray.js';
|
import isArray from './isArray.js';
|
||||||
|
import isBuffer from './isBuffer.js';
|
||||||
import isIndex from './_isIndex.js';
|
import isIndex from './_isIndex.js';
|
||||||
|
import isTypedArray from './isTypedArray.js';
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
@@ -18,18 +20,26 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
* @returns {Array} Returns the array of property names.
|
* @returns {Array} Returns the array of property names.
|
||||||
*/
|
*/
|
||||||
function arrayLikeKeys(value, inherited) {
|
function arrayLikeKeys(value, inherited) {
|
||||||
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
var isArr = isArray(value),
|
||||||
// Safari 9 makes `arguments.length` enumerable in strict mode.
|
isArg = !isArr && isArguments(value),
|
||||||
var result = (isArray(value) || isArguments(value))
|
isBuff = !isArr && !isArg && isBuffer(value),
|
||||||
? baseTimes(value.length, String)
|
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
||||||
: [];
|
skipIndexes = isArr || isArg || isBuff || isType,
|
||||||
|
result = skipIndexes ? baseTimes(value.length, String) : [],
|
||||||
var length = result.length,
|
length = result.length;
|
||||||
skipIndexes = !!length;
|
|
||||||
|
|
||||||
for (var key in value) {
|
for (var key in value) {
|
||||||
if ((inherited || hasOwnProperty.call(value, key)) &&
|
if ((inherited || hasOwnProperty.call(value, key)) &&
|
||||||
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
|
!(skipIndexes && (
|
||||||
|
// Safari 9 has enumerable `arguments.length` in strict mode.
|
||||||
|
key == 'length' ||
|
||||||
|
// Node.js 0.10 has enumerable non-index properties on buffers.
|
||||||
|
(isBuff && (key == 'offset' || key == 'parent')) ||
|
||||||
|
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
||||||
|
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
||||||
|
// Skip index properties.
|
||||||
|
isIndex(key, length)
|
||||||
|
))) {
|
||||||
result.push(key);
|
result.push(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import baseClamp from './_baseClamp.js';
|
||||||
import copyArray from './_copyArray.js';
|
import copyArray from './_copyArray.js';
|
||||||
import shuffleSelf from './_shuffleSelf.js';
|
import shuffleSelf from './_shuffleSelf.js';
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ import shuffleSelf from './_shuffleSelf.js';
|
|||||||
* @returns {Array} Returns the random elements.
|
* @returns {Array} Returns the random elements.
|
||||||
*/
|
*/
|
||||||
function arraySampleSize(array, n) {
|
function arraySampleSize(array, n) {
|
||||||
return shuffleSelf(copyArray(array), n);
|
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default arraySampleSize;
|
export default arraySampleSize;
|
||||||
|
|||||||
@@ -118,9 +118,7 @@ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
|
|||||||
}
|
}
|
||||||
stack.set(value, result);
|
stack.set(value, result);
|
||||||
|
|
||||||
if (!isArr) {
|
var props = isArr ? undefined : (isFull ? getAllKeys : keys)(value);
|
||||||
var props = isFull ? getAllKeys(value) : keys(value);
|
|
||||||
}
|
|
||||||
arrayEach(props || value, function(subValue, key) {
|
arrayEach(props || value, function(subValue, key) {
|
||||||
if (props) {
|
if (props) {
|
||||||
key = subValue;
|
key = subValue;
|
||||||
|
|||||||
27
_baseIsArguments.js
Normal file
27
_baseIsArguments.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import isObjectLike from './isObjectLike.js';
|
||||||
|
|
||||||
|
/** `Object#toString` result references. */
|
||||||
|
var argsTag = '[object Arguments]';
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to resolve the
|
||||||
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
|
* of values.
|
||||||
|
*/
|
||||||
|
var objectToString = objectProto.toString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.isArguments`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
||||||
|
*/
|
||||||
|
function baseIsArguments(value) {
|
||||||
|
return isObjectLike(value) && objectToString.call(value) == argsTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default baseIsArguments;
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
import Stack from './_Stack.js';
|
import Stack from './_Stack.js';
|
||||||
import arrayEach from './_arrayEach.js';
|
|
||||||
import assignMergeValue from './_assignMergeValue.js';
|
import assignMergeValue from './_assignMergeValue.js';
|
||||||
import baseKeysIn from './_baseKeysIn.js';
|
import baseFor from './_baseFor.js';
|
||||||
import baseMergeDeep from './_baseMergeDeep.js';
|
import baseMergeDeep from './_baseMergeDeep.js';
|
||||||
import isArray from './isArray.js';
|
|
||||||
import isObject from './isObject.js';
|
import isObject from './isObject.js';
|
||||||
import isTypedArray from './isTypedArray.js';
|
import keysIn from './keysIn.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.merge` without support for multiple sources.
|
* The base implementation of `_.merge` without support for multiple sources.
|
||||||
@@ -22,14 +20,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
|
|||||||
if (object === source) {
|
if (object === source) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(isArray(source) || isTypedArray(source))) {
|
baseFor(source, function(srcValue, key) {
|
||||||
var props = baseKeysIn(source);
|
|
||||||
}
|
|
||||||
arrayEach(props || source, function(srcValue, key) {
|
|
||||||
if (props) {
|
|
||||||
key = srcValue;
|
|
||||||
srcValue = source[key];
|
|
||||||
}
|
|
||||||
if (isObject(srcValue)) {
|
if (isObject(srcValue)) {
|
||||||
stack || (stack = new Stack);
|
stack || (stack = new Stack);
|
||||||
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
||||||
@@ -44,7 +35,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
|
|||||||
}
|
}
|
||||||
assignMergeValue(object, key, newValue);
|
assignMergeValue(object, key, newValue);
|
||||||
}
|
}
|
||||||
});
|
}, keysIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default baseMerge;
|
export default baseMerge;
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import assignMergeValue from './_assignMergeValue.js';
|
import assignMergeValue from './_assignMergeValue.js';
|
||||||
|
import cloneBuffer from './_cloneBuffer.js';
|
||||||
import cloneTypedArray from './_cloneTypedArray.js';
|
import cloneTypedArray from './_cloneTypedArray.js';
|
||||||
import copyArray from './_copyArray.js';
|
import copyArray from './_copyArray.js';
|
||||||
import initCloneObject from './_initCloneObject.js';
|
import initCloneObject from './_initCloneObject.js';
|
||||||
import isArguments from './isArguments.js';
|
import isArguments from './isArguments.js';
|
||||||
import isArray from './isArray.js';
|
import isArray from './isArray.js';
|
||||||
import isArrayLikeObject from './isArrayLikeObject.js';
|
import isArrayLikeObject from './isArrayLikeObject.js';
|
||||||
|
import isBuffer from './isBuffer.js';
|
||||||
import isFunction from './isFunction.js';
|
import isFunction from './isFunction.js';
|
||||||
import isObject from './isObject.js';
|
import isObject from './isObject.js';
|
||||||
import isPlainObject from './isPlainObject.js';
|
import isPlainObject from './isPlainObject.js';
|
||||||
@@ -43,16 +45,21 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
|
|||||||
|
|
||||||
if (isCommon) {
|
if (isCommon) {
|
||||||
var isArr = isArray(srcValue),
|
var isArr = isArray(srcValue),
|
||||||
isTyped = !isArr && isTypedArray(srcValue);
|
isBuff = !isArr && isBuffer(srcValue),
|
||||||
|
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
||||||
|
|
||||||
newValue = srcValue;
|
newValue = srcValue;
|
||||||
if (isArr || isTyped) {
|
if (isArr || isBuff || isTyped) {
|
||||||
if (isArray(objValue)) {
|
if (isArray(objValue)) {
|
||||||
newValue = objValue;
|
newValue = objValue;
|
||||||
}
|
}
|
||||||
else if (isArrayLikeObject(objValue)) {
|
else if (isArrayLikeObject(objValue)) {
|
||||||
newValue = copyArray(objValue);
|
newValue = copyArray(objValue);
|
||||||
}
|
}
|
||||||
|
else if (isBuff) {
|
||||||
|
isCommon = false;
|
||||||
|
newValue = cloneBuffer(srcValue, true);
|
||||||
|
}
|
||||||
else if (isTyped) {
|
else if (isTyped) {
|
||||||
isCommon = false;
|
isCommon = false;
|
||||||
newValue = cloneTypedArray(srcValue, true);
|
newValue = cloneTypedArray(srcValue, true);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import baseClamp from './_baseClamp.js';
|
||||||
import shuffleSelf from './_shuffleSelf.js';
|
import shuffleSelf from './_shuffleSelf.js';
|
||||||
import values from './values.js';
|
import values from './values.js';
|
||||||
|
|
||||||
@@ -10,7 +11,8 @@ import values from './values.js';
|
|||||||
* @returns {Array} Returns the random elements.
|
* @returns {Array} Returns the random elements.
|
||||||
*/
|
*/
|
||||||
function baseSampleSize(collection, n) {
|
function baseSampleSize(collection, n) {
|
||||||
return shuffleSelf(values(collection), n);
|
var array = values(collection);
|
||||||
|
return shuffleSelf(array, baseClamp(n, 0, array.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default baseSampleSize;
|
export default baseSampleSize;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import Symbol from './_Symbol.js';
|
import Symbol from './_Symbol.js';
|
||||||
|
import arrayMap from './_arrayMap.js';
|
||||||
|
import isArray from './isArray.js';
|
||||||
import isSymbol from './isSymbol.js';
|
import isSymbol from './isSymbol.js';
|
||||||
|
|
||||||
/** Used as references for various `Number` constants. */
|
/** Used as references for various `Number` constants. */
|
||||||
@@ -21,6 +23,10 @@ function baseToString(value) {
|
|||||||
if (typeof value == 'string') {
|
if (typeof value == 'string') {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
if (isArray(value)) {
|
||||||
|
// Recursively convert values (susceptible to call stack limits).
|
||||||
|
return arrayMap(value, baseToString) + '';
|
||||||
|
}
|
||||||
if (isSymbol(value)) {
|
if (isSymbol(value)) {
|
||||||
return symbolToString ? symbolToString.call(value) : '';
|
return symbolToString ? symbolToString.call(value) : '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import baseClamp from './_baseClamp.js';
|
|
||||||
import baseRandom from './_baseRandom.js';
|
import baseRandom from './_baseRandom.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,7 +13,7 @@ function shuffleSelf(array, size) {
|
|||||||
length = array.length,
|
length = array.length,
|
||||||
lastIndex = length - 1;
|
lastIndex = length - 1;
|
||||||
|
|
||||||
size = size === undefined ? length : baseClamp(size, 0, length);
|
size = size === undefined ? length : size;
|
||||||
while (++index < size) {
|
while (++index < size) {
|
||||||
var rand = baseRandom(index, lastIndex),
|
var rand = baseRandom(index, lastIndex),
|
||||||
value = array[rand];
|
value = array[rand];
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import isArrayLikeObject from './isArrayLikeObject.js';
|
import baseIsArguments from './_baseIsArguments.js';
|
||||||
|
import isObjectLike from './isObjectLike.js';
|
||||||
/** `Object#toString` result references. */
|
|
||||||
var argsTag = '[object Arguments]';
|
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
@@ -9,13 +7,6 @@ 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;
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to resolve the
|
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
||||||
* of values.
|
|
||||||
*/
|
|
||||||
var objectToString = objectProto.toString;
|
|
||||||
|
|
||||||
/** Built-in value references. */
|
/** Built-in value references. */
|
||||||
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||||
|
|
||||||
@@ -37,10 +28,9 @@ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|||||||
* _.isArguments([1, 2, 3]);
|
* _.isArguments([1, 2, 3]);
|
||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArguments(value) {
|
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
||||||
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
||||||
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
!propertyIsEnumerable.call(value, 'callee');
|
||||||
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
};
|
||||||
}
|
|
||||||
|
|
||||||
export default isArguments;
|
export default isArguments;
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
import baseKeys from './_baseKeys.js';
|
||||||
import getTag from './_getTag.js';
|
import getTag from './_getTag.js';
|
||||||
import isArguments from './isArguments.js';
|
import isArguments from './isArguments.js';
|
||||||
import isArray from './isArray.js';
|
import isArray from './isArray.js';
|
||||||
import isArrayLike from './isArrayLike.js';
|
import isArrayLike from './isArrayLike.js';
|
||||||
import isBuffer from './isBuffer.js';
|
import isBuffer from './isBuffer.js';
|
||||||
import isPrototype from './_isPrototype.js';
|
import isPrototype from './_isPrototype.js';
|
||||||
import nativeKeys from './_nativeKeys.js';
|
import isTypedArray from './isTypedArray.js';
|
||||||
|
|
||||||
/** `Object#toString` result references. */
|
/** `Object#toString` result references. */
|
||||||
var mapTag = '[object Map]',
|
var mapTag = '[object Map]',
|
||||||
@@ -51,8 +52,8 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
*/
|
*/
|
||||||
function isEmpty(value) {
|
function isEmpty(value) {
|
||||||
if (isArrayLike(value) &&
|
if (isArrayLike(value) &&
|
||||||
(isArray(value) || typeof value == 'string' ||
|
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
||||||
typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) {
|
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
||||||
return !value.length;
|
return !value.length;
|
||||||
}
|
}
|
||||||
var tag = getTag(value);
|
var tag = getTag(value);
|
||||||
@@ -60,7 +61,7 @@ function isEmpty(value) {
|
|||||||
return !value.size;
|
return !value.size;
|
||||||
}
|
}
|
||||||
if (isPrototype(value)) {
|
if (isPrototype(value)) {
|
||||||
return !nativeKeys(value).length;
|
return !baseKeys(value).length;
|
||||||
}
|
}
|
||||||
for (var key in value) {
|
for (var key in value) {
|
||||||
if (hasOwnProperty.call(value, key)) {
|
if (hasOwnProperty.call(value, key)) {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ var objectToString = objectProto.toString;
|
|||||||
*/
|
*/
|
||||||
function isFunction(value) {
|
function isFunction(value) {
|
||||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
// in Safari 9 which returns 'object' for typed array and other constructors.
|
||||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||||
return tag == funcTag || tag == genTag || tag == proxyTag;
|
return tag == funcTag || tag == genTag || tag == proxyTag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import toInteger from './toInteger.js';
|
|||||||
import lodash from './wrapperLodash.js';
|
import lodash from './wrapperLodash.js';
|
||||||
|
|
||||||
/** Used as the semantic version number. */
|
/** Used as the semantic version number. */
|
||||||
var VERSION = '4.16.3';
|
var VERSION = '4.16.4';
|
||||||
|
|
||||||
/** Used to compose bitmasks for function metadata. */
|
/** Used to compose bitmasks for function metadata. */
|
||||||
var BIND_KEY_FLAG = 2;
|
var BIND_KEY_FLAG = 2;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash-es",
|
"name": "lodash-es",
|
||||||
"version": "4.16.3",
|
"version": "4.16.4",
|
||||||
"description": "Lodash exported as ES modules.",
|
"description": "Lodash exported as ES modules.",
|
||||||
"keywords": "es6, modules, stdlib, util",
|
"keywords": "es6, modules, stdlib, util",
|
||||||
"homepage": "https://lodash.com/custom-builds",
|
"homepage": "https://lodash.com/custom-builds",
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import baseToString from './_baseToString.js';
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to process.
|
* @param {*} value The value to convert.
|
||||||
* @returns {string} Returns the string.
|
* @returns {string} Returns the converted string.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.toString(null);
|
* _.toString(null);
|
||||||
|
|||||||
24
transform.js
24
transform.js
@@ -4,6 +4,7 @@ import baseForOwn from './_baseForOwn.js';
|
|||||||
import baseIteratee from './_baseIteratee.js';
|
import baseIteratee from './_baseIteratee.js';
|
||||||
import getPrototype from './_getPrototype.js';
|
import getPrototype from './_getPrototype.js';
|
||||||
import isArray from './isArray.js';
|
import isArray from './isArray.js';
|
||||||
|
import isBuffer from './isBuffer.js';
|
||||||
import isFunction from './isFunction.js';
|
import isFunction from './isFunction.js';
|
||||||
import isObject from './isObject.js';
|
import isObject from './isObject.js';
|
||||||
import isTypedArray from './isTypedArray.js';
|
import isTypedArray from './isTypedArray.js';
|
||||||
@@ -39,22 +40,23 @@ import isTypedArray from './isTypedArray.js';
|
|||||||
* // => { '1': ['a', 'c'], '2': ['b'] }
|
* // => { '1': ['a', 'c'], '2': ['b'] }
|
||||||
*/
|
*/
|
||||||
function transform(object, iteratee, accumulator) {
|
function transform(object, iteratee, accumulator) {
|
||||||
var isArr = isArray(object) || isTypedArray(object);
|
var isArr = isArray(object),
|
||||||
iteratee = baseIteratee(iteratee, 4);
|
isArrLike = isArr || isBuffer(object) || isTypedArray(object);
|
||||||
|
|
||||||
|
iteratee = baseIteratee(iteratee, 4);
|
||||||
if (accumulator == null) {
|
if (accumulator == null) {
|
||||||
if (isArr || isObject(object)) {
|
var Ctor = object && object.constructor;
|
||||||
var Ctor = object.constructor;
|
if (isArrLike) {
|
||||||
if (isArr) {
|
accumulator = isArr ? new Ctor : [];
|
||||||
accumulator = isArray(object) ? new Ctor : [];
|
}
|
||||||
} else {
|
else if (isObject(object)) {
|
||||||
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
|
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
|
||||||
}
|
}
|
||||||
} else {
|
else {
|
||||||
accumulator = {};
|
accumulator = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
|
(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
|
||||||
return iteratee(accumulator, value, index, object);
|
return iteratee(accumulator, value, index, object);
|
||||||
});
|
});
|
||||||
return accumulator;
|
return accumulator;
|
||||||
|
|||||||
Reference in New Issue
Block a user