source: frontend/node_modules/es-abstract/2023/IsConcatSpreadable.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 636 bytes
Line 
1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true);
6
7var Get = require('./Get');
8var IsArray = require('./IsArray');
9var ToBoolean = require('./ToBoolean');
10
11var isObject = require('es-object-atoms/isObject');
12
13// https://262.ecma-international.org/6.0/#sec-isconcatspreadable
14
15module.exports = function IsConcatSpreadable(O) {
16 if (!isObject(O)) {
17 return false;
18 }
19 if ($isConcatSpreadable) {
20 var spreadable = Get(O, $isConcatSpreadable);
21 if (typeof spreadable !== 'undefined') {
22 return ToBoolean(spreadable);
23 }
24 }
25 return IsArray(O);
26};
Note: See TracBrowser for help on using the repository browser.