Frontend/25_01_07/mai/node_modules/es-abstract/2016/IsConcatSpreadable.js
szabomarton 7f4a15b9c3 asd
2025-01-28 11:38:27 +01:00

27 lines
631 B
JavaScript

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true);
var Get = require('./Get');
var IsArray = require('./IsArray');
var ToBoolean = require('./ToBoolean');
var isObject = require('../helpers/isObject');
// https://262.ecma-international.org/6.0/#sec-isconcatspreadable
module.exports = function IsConcatSpreadable(O) {
if (!isObject(O)) {
return false;
}
if ($isConcatSpreadable) {
var spreadable = Get(O, $isConcatSpreadable);
if (typeof spreadable !== 'undefined') {
return ToBoolean(spreadable);
}
}
return IsArray(O);
};