mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Fix isFlattenable.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
import isArguments from './isArguments.js';
|
import isArguments from './isArguments.js';
|
||||||
|
|
||||||
|
/** Built-in value reference. */
|
||||||
|
const spreadableSymbol = Symbol.isConcatSpreadable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is a flattenable `arguments` object or array.
|
* Checks if `value` is a flattenable `arguments` object or array.
|
||||||
*
|
*
|
||||||
@@ -9,7 +12,7 @@ import isArguments from './isArguments.js';
|
|||||||
*/
|
*/
|
||||||
function isFlattenable(value) {
|
function isFlattenable(value) {
|
||||||
return Array.isArray(value) || isArguments(value) ||
|
return Array.isArray(value) || isArguments(value) ||
|
||||||
!!(Symbol.isConcatSpreadable && value && value[spreadableSymbol]);
|
!!(spreadableSymbol && value && value[spreadableSymbol]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default isFlattenable;
|
export default isFlattenable;
|
||||||
|
|||||||
Reference in New Issue
Block a user