Assume ES5+ built-ins exist.

This commit is contained in:
John-David Dalton
2017-01-09 19:06:04 -08:00
parent 8501b0c2ef
commit 8bc7e006db
26 changed files with 18 additions and 117 deletions

View File

@@ -1,9 +1,5 @@
import Symbol from './_Symbol.js';
import isArguments from './isArguments.js';
/** Built-in value references. */
const spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
/**
* Checks if `value` is a flattenable `arguments` object or array.
*
@@ -13,7 +9,7 @@ const spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
*/
function isFlattenable(value) {
return Array.isArray(value) || isArguments(value) ||
!!(spreadableSymbol && value && value[spreadableSymbol]);
!!(Symbol.isConcatSpreadable && value && value[spreadableSymbol]);
}
export default isFlattenable;