mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Add isConcatSpreadable to flatten methods.
This commit is contained in:
@@ -1336,10 +1336,11 @@
|
||||
Symbol = context.Symbol,
|
||||
Uint8Array = context.Uint8Array,
|
||||
enumerate = Reflect ? Reflect.enumerate : undefined,
|
||||
iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
|
||||
iteratorSymbol = Symbol ? Symbol.iterator : undefined,
|
||||
objectCreate = context.Object.create,
|
||||
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
||||
splice = arrayProto.splice;
|
||||
splice = arrayProto.splice,
|
||||
spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
|
||||
|
||||
/** Built-in method references that are mockable. */
|
||||
var clearTimeout = function(id) { return context.clearTimeout.call(root, id); },
|
||||
@@ -5869,7 +5870,8 @@
|
||||
* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
|
||||
*/
|
||||
function isFlattenable(value) {
|
||||
return isArray(value) || isArguments(value);
|
||||
return isArray(value) || isArguments(value) ||
|
||||
!!(spreadableSymbol && value && value[spreadableSymbol])
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user