backlog-js 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/backlog.js +699 -212
- package/dist/backlog.min.js +1 -1
- package/dist/types/backlog.d.ts +5 -0
- package/dist/types/entity.d.ts +0 -1
- package/dist/types/error.d.ts +1 -1
- package/dist/types/option.d.ts +1 -1
- package/dist/types/request.d.ts +1 -1
- package/dist/types/types.d.ts +6 -6
- package/package.json +16 -16
package/dist/backlog.js
CHANGED
|
@@ -504,8 +504,15 @@ var Backlog = /** @class */ (function (_super) {
|
|
|
504
504
|
};
|
|
505
505
|
/**
|
|
506
506
|
* https://developer.nulab.com/docs/backlog/api/2/delete-issue/
|
|
507
|
+
* @deprecated Renamed to `deleteIssue`.
|
|
507
508
|
*/
|
|
508
509
|
Backlog.prototype.deleteIssuesCount = function (issueIdOrKey) {
|
|
510
|
+
return this.deleteIssue(issueIdOrKey);
|
|
511
|
+
};
|
|
512
|
+
/**
|
|
513
|
+
* https://developer.nulab.com/docs/backlog/api/2/delete-issue/
|
|
514
|
+
*/
|
|
515
|
+
Backlog.prototype.deleteIssue = function (issueIdOrKey) {
|
|
509
516
|
return this.delete("issues/".concat(issueIdOrKey));
|
|
510
517
|
};
|
|
511
518
|
/**
|
|
@@ -1154,7 +1161,7 @@ var Issue;
|
|
|
1154
1161
|
ParentChildType[ParentChildType["NotChildNotParent"] = 3] = "NotChildNotParent";
|
|
1155
1162
|
ParentChildType[ParentChildType["Parent"] = 4] = "Parent";
|
|
1156
1163
|
})(ParentChildType = Issue.ParentChildType || (Issue.ParentChildType = {}));
|
|
1157
|
-
})(Issue
|
|
1164
|
+
})(Issue || (exports.Issue = Issue = {}));
|
|
1158
1165
|
|
|
1159
1166
|
},{}],7:[function(require,module,exports){
|
|
1160
1167
|
"use strict";
|
|
@@ -1251,7 +1258,7 @@ var Request = /** @class */ (function () {
|
|
|
1251
1258
|
}());
|
|
1252
1259
|
exports.default = Request;
|
|
1253
1260
|
|
|
1254
|
-
},{"./error":3,"qs":
|
|
1261
|
+
},{"./error":3,"qs":32}],8:[function(require,module,exports){
|
|
1255
1262
|
"use strict";
|
|
1256
1263
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1257
1264
|
exports.CustomFieldType = exports.ActivityType = exports.NormalRoleType = exports.ClassicRoleType = void 0;
|
|
@@ -1263,14 +1270,14 @@ var ClassicRoleType;
|
|
|
1263
1270
|
ClassicRoleType[ClassicRoleType["Viewer"] = 4] = "Viewer";
|
|
1264
1271
|
ClassicRoleType[ClassicRoleType["GuestReporter"] = 5] = "GuestReporter";
|
|
1265
1272
|
ClassicRoleType[ClassicRoleType["GuestViewer"] = 6] = "GuestViewer";
|
|
1266
|
-
})(ClassicRoleType
|
|
1273
|
+
})(ClassicRoleType || (exports.ClassicRoleType = ClassicRoleType = {}));
|
|
1267
1274
|
var NormalRoleType;
|
|
1268
1275
|
(function (NormalRoleType) {
|
|
1269
1276
|
NormalRoleType[NormalRoleType["Admin"] = 1] = "Admin";
|
|
1270
1277
|
NormalRoleType[NormalRoleType["MemberOrGuest"] = 2] = "MemberOrGuest";
|
|
1271
1278
|
NormalRoleType[NormalRoleType["MemberOrGuestForAddIssues"] = 3] = "MemberOrGuestForAddIssues";
|
|
1272
1279
|
NormalRoleType[NormalRoleType["MemberOrGuestForViewIssues"] = 4] = "MemberOrGuestForViewIssues";
|
|
1273
|
-
})(NormalRoleType
|
|
1280
|
+
})(NormalRoleType || (exports.NormalRoleType = NormalRoleType = {}));
|
|
1274
1281
|
var ActivityType;
|
|
1275
1282
|
(function (ActivityType) {
|
|
1276
1283
|
ActivityType[ActivityType["Undefined"] = -1] = "Undefined";
|
|
@@ -1300,7 +1307,7 @@ var ActivityType;
|
|
|
1300
1307
|
ActivityType[ActivityType["MilestoneDeleted"] = 24] = "MilestoneDeleted";
|
|
1301
1308
|
ActivityType[ActivityType["ProjectGroupAdded"] = 25] = "ProjectGroupAdded";
|
|
1302
1309
|
ActivityType[ActivityType["ProjectGroupDeleted"] = 26] = "ProjectGroupDeleted";
|
|
1303
|
-
})(ActivityType
|
|
1310
|
+
})(ActivityType || (exports.ActivityType = ActivityType = {}));
|
|
1304
1311
|
var CustomFieldType;
|
|
1305
1312
|
(function (CustomFieldType) {
|
|
1306
1313
|
CustomFieldType[CustomFieldType["Text"] = 1] = "Text";
|
|
@@ -1311,7 +1318,7 @@ var CustomFieldType;
|
|
|
1311
1318
|
CustomFieldType[CustomFieldType["MultipleList"] = 6] = "MultipleList";
|
|
1312
1319
|
CustomFieldType[CustomFieldType["CheckBox"] = 7] = "CheckBox";
|
|
1313
1320
|
CustomFieldType[CustomFieldType["Radio"] = 8] = "Radio";
|
|
1314
|
-
})(CustomFieldType
|
|
1321
|
+
})(CustomFieldType || (exports.CustomFieldType = CustomFieldType = {}));
|
|
1315
1322
|
|
|
1316
1323
|
},{}],9:[function(require,module,exports){
|
|
1317
1324
|
|
|
@@ -1332,43 +1339,31 @@ module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
|
1332
1339
|
return intrinsic;
|
|
1333
1340
|
};
|
|
1334
1341
|
|
|
1335
|
-
},{"./":11,"get-intrinsic":
|
|
1342
|
+
},{"./":11,"get-intrinsic":23}],11:[function(require,module,exports){
|
|
1336
1343
|
'use strict';
|
|
1337
1344
|
|
|
1338
1345
|
var bind = require('function-bind');
|
|
1339
1346
|
var GetIntrinsic = require('get-intrinsic');
|
|
1347
|
+
var setFunctionLength = require('set-function-length');
|
|
1340
1348
|
|
|
1349
|
+
var $TypeError = require('es-errors/type');
|
|
1341
1350
|
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
1342
1351
|
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
1343
1352
|
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
1344
1353
|
|
|
1345
|
-
var $
|
|
1346
|
-
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
1354
|
+
var $defineProperty = require('es-define-property');
|
|
1347
1355
|
var $max = GetIntrinsic('%Math.max%');
|
|
1348
1356
|
|
|
1349
|
-
if ($defineProperty) {
|
|
1350
|
-
try {
|
|
1351
|
-
$defineProperty({}, 'a', { value: 1 });
|
|
1352
|
-
} catch (e) {
|
|
1353
|
-
// IE 8 has a broken defineProperty
|
|
1354
|
-
$defineProperty = null;
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
1357
|
module.exports = function callBind(originalFunction) {
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
var desc = $gOPD(func, 'length');
|
|
1362
|
-
if (desc.configurable) {
|
|
1363
|
-
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
1364
|
-
$defineProperty(
|
|
1365
|
-
func,
|
|
1366
|
-
'length',
|
|
1367
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
1368
|
-
);
|
|
1369
|
-
}
|
|
1358
|
+
if (typeof originalFunction !== 'function') {
|
|
1359
|
+
throw new $TypeError('a function is required');
|
|
1370
1360
|
}
|
|
1371
|
-
|
|
1361
|
+
var func = $reflectApply(bind, $call, arguments);
|
|
1362
|
+
return setFunctionLength(
|
|
1363
|
+
func,
|
|
1364
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
1365
|
+
true
|
|
1366
|
+
);
|
|
1372
1367
|
};
|
|
1373
1368
|
|
|
1374
1369
|
var applyBind = function applyBind() {
|
|
@@ -1381,49 +1376,199 @@ if ($defineProperty) {
|
|
|
1381
1376
|
module.exports.apply = applyBind;
|
|
1382
1377
|
}
|
|
1383
1378
|
|
|
1384
|
-
},{"function-bind":
|
|
1379
|
+
},{"es-define-property":13,"es-errors/type":19,"function-bind":22,"get-intrinsic":23,"set-function-length":36}],12:[function(require,module,exports){
|
|
1380
|
+
'use strict';
|
|
1381
|
+
|
|
1382
|
+
var $defineProperty = require('es-define-property');
|
|
1383
|
+
|
|
1384
|
+
var $SyntaxError = require('es-errors/syntax');
|
|
1385
|
+
var $TypeError = require('es-errors/type');
|
|
1386
|
+
|
|
1387
|
+
var gopd = require('gopd');
|
|
1388
|
+
|
|
1389
|
+
/** @type {import('.')} */
|
|
1390
|
+
module.exports = function defineDataProperty(
|
|
1391
|
+
obj,
|
|
1392
|
+
property,
|
|
1393
|
+
value
|
|
1394
|
+
) {
|
|
1395
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
1396
|
+
throw new $TypeError('`obj` must be an object or a function`');
|
|
1397
|
+
}
|
|
1398
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
1399
|
+
throw new $TypeError('`property` must be a string or a symbol`');
|
|
1400
|
+
}
|
|
1401
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
1402
|
+
throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
|
|
1403
|
+
}
|
|
1404
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
1405
|
+
throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
|
|
1406
|
+
}
|
|
1407
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
1408
|
+
throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
|
|
1409
|
+
}
|
|
1410
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
1411
|
+
throw new $TypeError('`loose`, if provided, must be a boolean');
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
1415
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
1416
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
1417
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
1418
|
+
|
|
1419
|
+
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
|
1420
|
+
var desc = !!gopd && gopd(obj, property);
|
|
1421
|
+
|
|
1422
|
+
if ($defineProperty) {
|
|
1423
|
+
$defineProperty(obj, property, {
|
|
1424
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
1425
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
1426
|
+
value: value,
|
|
1427
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
1428
|
+
});
|
|
1429
|
+
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
|
1430
|
+
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
|
1431
|
+
obj[property] = value; // eslint-disable-line no-param-reassign
|
|
1432
|
+
} else {
|
|
1433
|
+
throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
|
|
1437
|
+
},{"es-define-property":13,"es-errors/syntax":18,"es-errors/type":19,"gopd":24}],13:[function(require,module,exports){
|
|
1438
|
+
'use strict';
|
|
1439
|
+
|
|
1440
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
1441
|
+
|
|
1442
|
+
/** @type {import('.')} */
|
|
1443
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
|
|
1444
|
+
if ($defineProperty) {
|
|
1445
|
+
try {
|
|
1446
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
1447
|
+
} catch (e) {
|
|
1448
|
+
// IE 8 has a broken defineProperty
|
|
1449
|
+
$defineProperty = false;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
module.exports = $defineProperty;
|
|
1454
|
+
|
|
1455
|
+
},{"get-intrinsic":23}],14:[function(require,module,exports){
|
|
1456
|
+
'use strict';
|
|
1457
|
+
|
|
1458
|
+
/** @type {import('./eval')} */
|
|
1459
|
+
module.exports = EvalError;
|
|
1460
|
+
|
|
1461
|
+
},{}],15:[function(require,module,exports){
|
|
1462
|
+
'use strict';
|
|
1463
|
+
|
|
1464
|
+
/** @type {import('.')} */
|
|
1465
|
+
module.exports = Error;
|
|
1466
|
+
|
|
1467
|
+
},{}],16:[function(require,module,exports){
|
|
1468
|
+
'use strict';
|
|
1469
|
+
|
|
1470
|
+
/** @type {import('./range')} */
|
|
1471
|
+
module.exports = RangeError;
|
|
1472
|
+
|
|
1473
|
+
},{}],17:[function(require,module,exports){
|
|
1474
|
+
'use strict';
|
|
1475
|
+
|
|
1476
|
+
/** @type {import('./ref')} */
|
|
1477
|
+
module.exports = ReferenceError;
|
|
1478
|
+
|
|
1479
|
+
},{}],18:[function(require,module,exports){
|
|
1480
|
+
'use strict';
|
|
1481
|
+
|
|
1482
|
+
/** @type {import('./syntax')} */
|
|
1483
|
+
module.exports = SyntaxError;
|
|
1484
|
+
|
|
1485
|
+
},{}],19:[function(require,module,exports){
|
|
1486
|
+
'use strict';
|
|
1487
|
+
|
|
1488
|
+
/** @type {import('./type')} */
|
|
1489
|
+
module.exports = TypeError;
|
|
1490
|
+
|
|
1491
|
+
},{}],20:[function(require,module,exports){
|
|
1492
|
+
'use strict';
|
|
1493
|
+
|
|
1494
|
+
/** @type {import('./uri')} */
|
|
1495
|
+
module.exports = URIError;
|
|
1496
|
+
|
|
1497
|
+
},{}],21:[function(require,module,exports){
|
|
1385
1498
|
'use strict';
|
|
1386
1499
|
|
|
1387
1500
|
/* eslint no-invalid-this: 1 */
|
|
1388
1501
|
|
|
1389
1502
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
1390
|
-
var slice = Array.prototype.slice;
|
|
1391
1503
|
var toStr = Object.prototype.toString;
|
|
1504
|
+
var max = Math.max;
|
|
1392
1505
|
var funcType = '[object Function]';
|
|
1393
1506
|
|
|
1507
|
+
var concatty = function concatty(a, b) {
|
|
1508
|
+
var arr = [];
|
|
1509
|
+
|
|
1510
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
1511
|
+
arr[i] = a[i];
|
|
1512
|
+
}
|
|
1513
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
1514
|
+
arr[j + a.length] = b[j];
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
return arr;
|
|
1518
|
+
};
|
|
1519
|
+
|
|
1520
|
+
var slicy = function slicy(arrLike, offset) {
|
|
1521
|
+
var arr = [];
|
|
1522
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
1523
|
+
arr[j] = arrLike[i];
|
|
1524
|
+
}
|
|
1525
|
+
return arr;
|
|
1526
|
+
};
|
|
1527
|
+
|
|
1528
|
+
var joiny = function (arr, joiner) {
|
|
1529
|
+
var str = '';
|
|
1530
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
1531
|
+
str += arr[i];
|
|
1532
|
+
if (i + 1 < arr.length) {
|
|
1533
|
+
str += joiner;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
return str;
|
|
1537
|
+
};
|
|
1538
|
+
|
|
1394
1539
|
module.exports = function bind(that) {
|
|
1395
1540
|
var target = this;
|
|
1396
|
-
if (typeof target !== 'function' || toStr.
|
|
1541
|
+
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
|
|
1397
1542
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
1398
1543
|
}
|
|
1399
|
-
var args =
|
|
1544
|
+
var args = slicy(arguments, 1);
|
|
1400
1545
|
|
|
1401
1546
|
var bound;
|
|
1402
1547
|
var binder = function () {
|
|
1403
1548
|
if (this instanceof bound) {
|
|
1404
1549
|
var result = target.apply(
|
|
1405
1550
|
this,
|
|
1406
|
-
args
|
|
1551
|
+
concatty(args, arguments)
|
|
1407
1552
|
);
|
|
1408
1553
|
if (Object(result) === result) {
|
|
1409
1554
|
return result;
|
|
1410
1555
|
}
|
|
1411
1556
|
return this;
|
|
1412
|
-
} else {
|
|
1413
|
-
return target.apply(
|
|
1414
|
-
that,
|
|
1415
|
-
args.concat(slice.call(arguments))
|
|
1416
|
-
);
|
|
1417
1557
|
}
|
|
1558
|
+
return target.apply(
|
|
1559
|
+
that,
|
|
1560
|
+
concatty(args, arguments)
|
|
1561
|
+
);
|
|
1562
|
+
|
|
1418
1563
|
};
|
|
1419
1564
|
|
|
1420
|
-
var boundLength =
|
|
1565
|
+
var boundLength = max(0, target.length - args.length);
|
|
1421
1566
|
var boundArgs = [];
|
|
1422
1567
|
for (var i = 0; i < boundLength; i++) {
|
|
1423
|
-
boundArgs
|
|
1568
|
+
boundArgs[i] = '$' + i;
|
|
1424
1569
|
}
|
|
1425
1570
|
|
|
1426
|
-
bound = Function('binder', 'return function (' + boundArgs
|
|
1571
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
1427
1572
|
|
|
1428
1573
|
if (target.prototype) {
|
|
1429
1574
|
var Empty = function Empty() {};
|
|
@@ -1435,21 +1580,27 @@ module.exports = function bind(that) {
|
|
|
1435
1580
|
return bound;
|
|
1436
1581
|
};
|
|
1437
1582
|
|
|
1438
|
-
},{}],
|
|
1583
|
+
},{}],22:[function(require,module,exports){
|
|
1439
1584
|
'use strict';
|
|
1440
1585
|
|
|
1441
1586
|
var implementation = require('./implementation');
|
|
1442
1587
|
|
|
1443
1588
|
module.exports = Function.prototype.bind || implementation;
|
|
1444
1589
|
|
|
1445
|
-
},{"./implementation":
|
|
1590
|
+
},{"./implementation":21}],23:[function(require,module,exports){
|
|
1446
1591
|
'use strict';
|
|
1447
1592
|
|
|
1448
1593
|
var undefined;
|
|
1449
1594
|
|
|
1450
|
-
var $
|
|
1595
|
+
var $Error = require('es-errors');
|
|
1596
|
+
var $EvalError = require('es-errors/eval');
|
|
1597
|
+
var $RangeError = require('es-errors/range');
|
|
1598
|
+
var $ReferenceError = require('es-errors/ref');
|
|
1599
|
+
var $SyntaxError = require('es-errors/syntax');
|
|
1600
|
+
var $TypeError = require('es-errors/type');
|
|
1601
|
+
var $URIError = require('es-errors/uri');
|
|
1602
|
+
|
|
1451
1603
|
var $Function = Function;
|
|
1452
|
-
var $TypeError = TypeError;
|
|
1453
1604
|
|
|
1454
1605
|
// eslint-disable-next-line consistent-return
|
|
1455
1606
|
var getEvalledConstructor = function (expressionSyntax) {
|
|
@@ -1488,18 +1639,24 @@ var ThrowTypeError = $gOPD
|
|
|
1488
1639
|
: throwTypeError;
|
|
1489
1640
|
|
|
1490
1641
|
var hasSymbols = require('has-symbols')();
|
|
1642
|
+
var hasProto = require('has-proto')();
|
|
1491
1643
|
|
|
1492
|
-
var getProto = Object.getPrototypeOf ||
|
|
1644
|
+
var getProto = Object.getPrototypeOf || (
|
|
1645
|
+
hasProto
|
|
1646
|
+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
1647
|
+
: null
|
|
1648
|
+
);
|
|
1493
1649
|
|
|
1494
1650
|
var needsEval = {};
|
|
1495
1651
|
|
|
1496
|
-
var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
|
|
1652
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
|
|
1497
1653
|
|
|
1498
1654
|
var INTRINSICS = {
|
|
1655
|
+
__proto__: null,
|
|
1499
1656
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
|
1500
1657
|
'%Array%': Array,
|
|
1501
1658
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
|
1502
|
-
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
|
|
1659
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
|
|
1503
1660
|
'%AsyncFromSyncIteratorPrototype%': undefined,
|
|
1504
1661
|
'%AsyncFunction%': needsEval,
|
|
1505
1662
|
'%AsyncGenerator%': needsEval,
|
|
@@ -1507,6 +1664,8 @@ var INTRINSICS = {
|
|
|
1507
1664
|
'%AsyncIteratorPrototype%': needsEval,
|
|
1508
1665
|
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
|
1509
1666
|
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
|
|
1667
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
|
|
1668
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
|
|
1510
1669
|
'%Boolean%': Boolean,
|
|
1511
1670
|
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
|
1512
1671
|
'%Date%': Date,
|
|
@@ -1514,9 +1673,9 @@ var INTRINSICS = {
|
|
|
1514
1673
|
'%decodeURIComponent%': decodeURIComponent,
|
|
1515
1674
|
'%encodeURI%': encodeURI,
|
|
1516
1675
|
'%encodeURIComponent%': encodeURIComponent,
|
|
1517
|
-
'%Error%': Error,
|
|
1676
|
+
'%Error%': $Error,
|
|
1518
1677
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
1519
|
-
'%EvalError%': EvalError,
|
|
1678
|
+
'%EvalError%': $EvalError,
|
|
1520
1679
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
|
1521
1680
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
|
1522
1681
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
|
|
@@ -1527,10 +1686,10 @@ var INTRINSICS = {
|
|
|
1527
1686
|
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
|
1528
1687
|
'%isFinite%': isFinite,
|
|
1529
1688
|
'%isNaN%': isNaN,
|
|
1530
|
-
'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
1689
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
1531
1690
|
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
|
1532
1691
|
'%Map%': typeof Map === 'undefined' ? undefined : Map,
|
|
1533
|
-
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
1692
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
1534
1693
|
'%Math%': Math,
|
|
1535
1694
|
'%Number%': Number,
|
|
1536
1695
|
'%Object%': Object,
|
|
@@ -1538,15 +1697,15 @@ var INTRINSICS = {
|
|
|
1538
1697
|
'%parseInt%': parseInt,
|
|
1539
1698
|
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
|
1540
1699
|
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
|
1541
|
-
'%RangeError%': RangeError,
|
|
1542
|
-
'%ReferenceError%': ReferenceError,
|
|
1700
|
+
'%RangeError%': $RangeError,
|
|
1701
|
+
'%ReferenceError%': $ReferenceError,
|
|
1543
1702
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
|
1544
1703
|
'%RegExp%': RegExp,
|
|
1545
1704
|
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
|
1546
|
-
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
|
|
1705
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
|
|
1547
1706
|
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
|
1548
1707
|
'%String%': String,
|
|
1549
|
-
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
|
|
1708
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
|
|
1550
1709
|
'%Symbol%': hasSymbols ? Symbol : undefined,
|
|
1551
1710
|
'%SyntaxError%': $SyntaxError,
|
|
1552
1711
|
'%ThrowTypeError%': ThrowTypeError,
|
|
@@ -1556,12 +1715,22 @@ var INTRINSICS = {
|
|
|
1556
1715
|
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
|
1557
1716
|
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
|
1558
1717
|
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
|
1559
|
-
'%URIError%': URIError,
|
|
1718
|
+
'%URIError%': $URIError,
|
|
1560
1719
|
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
|
1561
1720
|
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
|
1562
1721
|
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
|
|
1563
1722
|
};
|
|
1564
1723
|
|
|
1724
|
+
if (getProto) {
|
|
1725
|
+
try {
|
|
1726
|
+
null.error; // eslint-disable-line no-unused-expressions
|
|
1727
|
+
} catch (e) {
|
|
1728
|
+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
1729
|
+
var errorProto = getProto(getProto(e));
|
|
1730
|
+
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1565
1734
|
var doEval = function doEval(name) {
|
|
1566
1735
|
var value;
|
|
1567
1736
|
if (name === '%AsyncFunction%') {
|
|
@@ -1577,7 +1746,7 @@ var doEval = function doEval(name) {
|
|
|
1577
1746
|
}
|
|
1578
1747
|
} else if (name === '%AsyncIteratorPrototype%') {
|
|
1579
1748
|
var gen = doEval('%AsyncGenerator%');
|
|
1580
|
-
if (gen) {
|
|
1749
|
+
if (gen && getProto) {
|
|
1581
1750
|
value = getProto(gen.prototype);
|
|
1582
1751
|
}
|
|
1583
1752
|
}
|
|
@@ -1588,6 +1757,7 @@ var doEval = function doEval(name) {
|
|
|
1588
1757
|
};
|
|
1589
1758
|
|
|
1590
1759
|
var LEGACY_ALIASES = {
|
|
1760
|
+
__proto__: null,
|
|
1591
1761
|
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
1592
1762
|
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
1593
1763
|
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
@@ -1642,11 +1812,12 @@ var LEGACY_ALIASES = {
|
|
|
1642
1812
|
};
|
|
1643
1813
|
|
|
1644
1814
|
var bind = require('function-bind');
|
|
1645
|
-
var hasOwn = require('
|
|
1815
|
+
var hasOwn = require('hasown');
|
|
1646
1816
|
var $concat = bind.call(Function.call, Array.prototype.concat);
|
|
1647
1817
|
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
1648
1818
|
var $replace = bind.call(Function.call, String.prototype.replace);
|
|
1649
1819
|
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
1820
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
1650
1821
|
|
|
1651
1822
|
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
1652
1823
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
@@ -1702,6 +1873,9 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
1702
1873
|
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
1703
1874
|
}
|
|
1704
1875
|
|
|
1876
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
1877
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
1878
|
+
}
|
|
1705
1879
|
var parts = stringToPath(name);
|
|
1706
1880
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
1707
1881
|
|
|
@@ -1774,7 +1948,66 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
1774
1948
|
return value;
|
|
1775
1949
|
};
|
|
1776
1950
|
|
|
1777
|
-
},{"function-bind":
|
|
1951
|
+
},{"es-errors":15,"es-errors/eval":14,"es-errors/range":16,"es-errors/ref":17,"es-errors/syntax":18,"es-errors/type":19,"es-errors/uri":20,"function-bind":22,"has-proto":26,"has-symbols":27,"hasown":29}],24:[function(require,module,exports){
|
|
1952
|
+
'use strict';
|
|
1953
|
+
|
|
1954
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
1955
|
+
|
|
1956
|
+
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
1957
|
+
|
|
1958
|
+
if ($gOPD) {
|
|
1959
|
+
try {
|
|
1960
|
+
$gOPD([], 'length');
|
|
1961
|
+
} catch (e) {
|
|
1962
|
+
// IE 8 has a broken gOPD
|
|
1963
|
+
$gOPD = null;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
module.exports = $gOPD;
|
|
1968
|
+
|
|
1969
|
+
},{"get-intrinsic":23}],25:[function(require,module,exports){
|
|
1970
|
+
'use strict';
|
|
1971
|
+
|
|
1972
|
+
var $defineProperty = require('es-define-property');
|
|
1973
|
+
|
|
1974
|
+
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
|
1975
|
+
return !!$defineProperty;
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
1979
|
+
// node v0.6 has a bug where array lengths can be Set but not Defined
|
|
1980
|
+
if (!$defineProperty) {
|
|
1981
|
+
return null;
|
|
1982
|
+
}
|
|
1983
|
+
try {
|
|
1984
|
+
return $defineProperty([], 'length', { value: 1 }).length !== 1;
|
|
1985
|
+
} catch (e) {
|
|
1986
|
+
// In Firefox 4-22, defining length on an array throws an exception.
|
|
1987
|
+
return true;
|
|
1988
|
+
}
|
|
1989
|
+
};
|
|
1990
|
+
|
|
1991
|
+
module.exports = hasPropertyDescriptors;
|
|
1992
|
+
|
|
1993
|
+
},{"es-define-property":13}],26:[function(require,module,exports){
|
|
1994
|
+
'use strict';
|
|
1995
|
+
|
|
1996
|
+
var test = {
|
|
1997
|
+
__proto__: null,
|
|
1998
|
+
foo: {}
|
|
1999
|
+
};
|
|
2000
|
+
|
|
2001
|
+
var $Object = Object;
|
|
2002
|
+
|
|
2003
|
+
/** @type {import('.')} */
|
|
2004
|
+
module.exports = function hasProto() {
|
|
2005
|
+
// @ts-expect-error: TS errors on an inherited property for some reason
|
|
2006
|
+
return { __proto__: test }.foo === test.foo
|
|
2007
|
+
&& !(test instanceof $Object);
|
|
2008
|
+
};
|
|
2009
|
+
|
|
2010
|
+
},{}],27:[function(require,module,exports){
|
|
1778
2011
|
'use strict';
|
|
1779
2012
|
|
|
1780
2013
|
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
@@ -1789,7 +2022,7 @@ module.exports = function hasNativeSymbols() {
|
|
|
1789
2022
|
return hasSymbolSham();
|
|
1790
2023
|
};
|
|
1791
2024
|
|
|
1792
|
-
},{"./shams":
|
|
2025
|
+
},{"./shams":28}],28:[function(require,module,exports){
|
|
1793
2026
|
'use strict';
|
|
1794
2027
|
|
|
1795
2028
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
@@ -1833,14 +2066,18 @@ module.exports = function hasSymbols() {
|
|
|
1833
2066
|
return true;
|
|
1834
2067
|
};
|
|
1835
2068
|
|
|
1836
|
-
},{}],
|
|
2069
|
+
},{}],29:[function(require,module,exports){
|
|
1837
2070
|
'use strict';
|
|
1838
2071
|
|
|
2072
|
+
var call = Function.prototype.call;
|
|
2073
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
1839
2074
|
var bind = require('function-bind');
|
|
1840
2075
|
|
|
1841
|
-
|
|
2076
|
+
/** @type {import('.')} */
|
|
2077
|
+
module.exports = bind.call(call, $hasOwn);
|
|
1842
2078
|
|
|
1843
|
-
},{"function-bind":
|
|
2079
|
+
},{"function-bind":22}],30:[function(require,module,exports){
|
|
2080
|
+
(function (global){(function (){
|
|
1844
2081
|
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
1845
2082
|
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
1846
2083
|
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
@@ -1853,17 +2090,64 @@ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
|
|
1853
2090
|
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
1854
2091
|
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
|
1855
2092
|
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
2093
|
+
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
|
2094
|
+
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
1856
2095
|
var booleanValueOf = Boolean.prototype.valueOf;
|
|
1857
2096
|
var objectToString = Object.prototype.toString;
|
|
1858
2097
|
var functionToString = Function.prototype.toString;
|
|
1859
|
-
var match = String.prototype.match;
|
|
2098
|
+
var $match = String.prototype.match;
|
|
2099
|
+
var $slice = String.prototype.slice;
|
|
2100
|
+
var $replace = String.prototype.replace;
|
|
2101
|
+
var $toUpperCase = String.prototype.toUpperCase;
|
|
2102
|
+
var $toLowerCase = String.prototype.toLowerCase;
|
|
2103
|
+
var $test = RegExp.prototype.test;
|
|
2104
|
+
var $concat = Array.prototype.concat;
|
|
2105
|
+
var $join = Array.prototype.join;
|
|
2106
|
+
var $arrSlice = Array.prototype.slice;
|
|
2107
|
+
var $floor = Math.floor;
|
|
1860
2108
|
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
1861
2109
|
var gOPS = Object.getOwnPropertySymbols;
|
|
1862
|
-
var symToString = typeof Symbol === 'function' ? Symbol.prototype.toString : null;
|
|
2110
|
+
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
|
2111
|
+
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
|
2112
|
+
// ie, `has-tostringtag/shams
|
|
2113
|
+
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
|
|
2114
|
+
? Symbol.toStringTag
|
|
2115
|
+
: null;
|
|
1863
2116
|
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1864
2117
|
|
|
1865
|
-
var
|
|
1866
|
-
|
|
2118
|
+
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
|
2119
|
+
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
|
2120
|
+
? function (O) {
|
|
2121
|
+
return O.__proto__; // eslint-disable-line no-proto
|
|
2122
|
+
}
|
|
2123
|
+
: null
|
|
2124
|
+
);
|
|
2125
|
+
|
|
2126
|
+
function addNumericSeparator(num, str) {
|
|
2127
|
+
if (
|
|
2128
|
+
num === Infinity
|
|
2129
|
+
|| num === -Infinity
|
|
2130
|
+
|| num !== num
|
|
2131
|
+
|| (num && num > -1000 && num < 1000)
|
|
2132
|
+
|| $test.call(/e/, str)
|
|
2133
|
+
) {
|
|
2134
|
+
return str;
|
|
2135
|
+
}
|
|
2136
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
2137
|
+
if (typeof num === 'number') {
|
|
2138
|
+
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
|
|
2139
|
+
if (int !== num) {
|
|
2140
|
+
var intStr = String(int);
|
|
2141
|
+
var dec = $slice.call(str, intStr.length + 1);
|
|
2142
|
+
return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
return $replace.call(str, sepRegex, '$&_');
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
var utilInspect = require('./util.inspect');
|
|
2149
|
+
var inspectCustom = utilInspect.custom;
|
|
2150
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
1867
2151
|
|
|
1868
2152
|
module.exports = function inspect_(obj, options, depth, seen) {
|
|
1869
2153
|
var opts = options || {};
|
|
@@ -1880,8 +2164,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
1880
2164
|
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
1881
2165
|
}
|
|
1882
2166
|
var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
|
|
1883
|
-
if (typeof customInspect !== 'boolean') {
|
|
1884
|
-
throw new TypeError('option "customInspect", if provided, must be `true` or `
|
|
2167
|
+
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
|
2168
|
+
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
|
1885
2169
|
}
|
|
1886
2170
|
|
|
1887
2171
|
if (
|
|
@@ -1890,8 +2174,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
1890
2174
|
&& opts.indent !== '\t'
|
|
1891
2175
|
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
|
1892
2176
|
) {
|
|
1893
|
-
throw new TypeError('
|
|
2177
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
1894
2178
|
}
|
|
2179
|
+
if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
|
|
2180
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
2181
|
+
}
|
|
2182
|
+
var numericSeparator = opts.numericSeparator;
|
|
1895
2183
|
|
|
1896
2184
|
if (typeof obj === 'undefined') {
|
|
1897
2185
|
return 'undefined';
|
|
@@ -1910,10 +2198,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
1910
2198
|
if (obj === 0) {
|
|
1911
2199
|
return Infinity / obj > 0 ? '0' : '-0';
|
|
1912
2200
|
}
|
|
1913
|
-
|
|
2201
|
+
var str = String(obj);
|
|
2202
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
1914
2203
|
}
|
|
1915
2204
|
if (typeof obj === 'bigint') {
|
|
1916
|
-
|
|
2205
|
+
var bigIntStr = String(obj) + 'n';
|
|
2206
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
1917
2207
|
}
|
|
1918
2208
|
|
|
1919
2209
|
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
|
@@ -1932,7 +2222,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
1932
2222
|
|
|
1933
2223
|
function inspect(value, from, noIndent) {
|
|
1934
2224
|
if (from) {
|
|
1935
|
-
seen =
|
|
2225
|
+
seen = $arrSlice.call(seen);
|
|
1936
2226
|
seen.push(from);
|
|
1937
2227
|
}
|
|
1938
2228
|
if (noIndent) {
|
|
@@ -1947,24 +2237,24 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
1947
2237
|
return inspect_(value, opts, depth + 1, seen);
|
|
1948
2238
|
}
|
|
1949
2239
|
|
|
1950
|
-
if (typeof obj === 'function') {
|
|
2240
|
+
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
|
|
1951
2241
|
var name = nameOf(obj);
|
|
1952
2242
|
var keys = arrObjKeys(obj, inspect);
|
|
1953
|
-
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' +
|
|
2243
|
+
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
1954
2244
|
}
|
|
1955
2245
|
if (isSymbol(obj)) {
|
|
1956
|
-
var symString = symToString.call(obj);
|
|
1957
|
-
return typeof obj === 'object' ? markBoxed(symString) : symString;
|
|
2246
|
+
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
|
2247
|
+
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
1958
2248
|
}
|
|
1959
2249
|
if (isElement(obj)) {
|
|
1960
|
-
var s = '<' + String(obj.nodeName)
|
|
2250
|
+
var s = '<' + $toLowerCase.call(String(obj.nodeName));
|
|
1961
2251
|
var attrs = obj.attributes || [];
|
|
1962
2252
|
for (var i = 0; i < attrs.length; i++) {
|
|
1963
2253
|
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
|
|
1964
2254
|
}
|
|
1965
2255
|
s += '>';
|
|
1966
2256
|
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
|
|
1967
|
-
s += '</' + String(obj.nodeName)
|
|
2257
|
+
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
|
|
1968
2258
|
return s;
|
|
1969
2259
|
}
|
|
1970
2260
|
if (isArray(obj)) {
|
|
@@ -1973,32 +2263,39 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
1973
2263
|
if (indent && !singleLineValues(xs)) {
|
|
1974
2264
|
return '[' + indentedJoin(xs, indent) + ']';
|
|
1975
2265
|
}
|
|
1976
|
-
return '[ ' +
|
|
2266
|
+
return '[ ' + $join.call(xs, ', ') + ' ]';
|
|
1977
2267
|
}
|
|
1978
2268
|
if (isError(obj)) {
|
|
1979
2269
|
var parts = arrObjKeys(obj, inspect);
|
|
2270
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
2271
|
+
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
2272
|
+
}
|
|
1980
2273
|
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
1981
|
-
return '{ [' + String(obj) + '] ' +
|
|
2274
|
+
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
1982
2275
|
}
|
|
1983
2276
|
if (typeof obj === 'object' && customInspect) {
|
|
1984
|
-
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
|
1985
|
-
return obj
|
|
1986
|
-
} else if (typeof obj.inspect === 'function') {
|
|
2277
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
2278
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
2279
|
+
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
1987
2280
|
return obj.inspect();
|
|
1988
2281
|
}
|
|
1989
2282
|
}
|
|
1990
2283
|
if (isMap(obj)) {
|
|
1991
2284
|
var mapParts = [];
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2285
|
+
if (mapForEach) {
|
|
2286
|
+
mapForEach.call(obj, function (value, key) {
|
|
2287
|
+
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
1995
2290
|
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
|
1996
2291
|
}
|
|
1997
2292
|
if (isSet(obj)) {
|
|
1998
2293
|
var setParts = [];
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2294
|
+
if (setForEach) {
|
|
2295
|
+
setForEach.call(obj, function (value) {
|
|
2296
|
+
setParts.push(inspect(value, obj));
|
|
2297
|
+
});
|
|
2298
|
+
}
|
|
2002
2299
|
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
|
2003
2300
|
}
|
|
2004
2301
|
if (isWeakMap(obj)) {
|
|
@@ -2007,6 +2304,9 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
2007
2304
|
if (isWeakSet(obj)) {
|
|
2008
2305
|
return weakCollectionOf('WeakSet');
|
|
2009
2306
|
}
|
|
2307
|
+
if (isWeakRef(obj)) {
|
|
2308
|
+
return weakCollectionOf('WeakRef');
|
|
2309
|
+
}
|
|
2010
2310
|
if (isNumber(obj)) {
|
|
2011
2311
|
return markBoxed(inspect(Number(obj)));
|
|
2012
2312
|
}
|
|
@@ -2019,13 +2319,29 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
2019
2319
|
if (isString(obj)) {
|
|
2020
2320
|
return markBoxed(inspect(String(obj)));
|
|
2021
2321
|
}
|
|
2322
|
+
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
2323
|
+
/* eslint-env browser */
|
|
2324
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
2325
|
+
return '{ [object Window] }';
|
|
2326
|
+
}
|
|
2327
|
+
if (
|
|
2328
|
+
(typeof globalThis !== 'undefined' && obj === globalThis)
|
|
2329
|
+
|| (typeof global !== 'undefined' && obj === global)
|
|
2330
|
+
) {
|
|
2331
|
+
return '{ [object globalThis] }';
|
|
2332
|
+
}
|
|
2022
2333
|
if (!isDate(obj) && !isRegExp(obj)) {
|
|
2023
2334
|
var ys = arrObjKeys(obj, inspect);
|
|
2024
|
-
|
|
2335
|
+
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
2336
|
+
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
|
2337
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
|
|
2338
|
+
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
|
2339
|
+
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
|
|
2340
|
+
if (ys.length === 0) { return tag + '{}'; }
|
|
2025
2341
|
if (indent) {
|
|
2026
|
-
return '{' + indentedJoin(ys, indent) + '}';
|
|
2342
|
+
return tag + '{' + indentedJoin(ys, indent) + '}';
|
|
2027
2343
|
}
|
|
2028
|
-
return '{ ' +
|
|
2344
|
+
return tag + '{ ' + $join.call(ys, ', ') + ' }';
|
|
2029
2345
|
}
|
|
2030
2346
|
return String(obj);
|
|
2031
2347
|
};
|
|
@@ -2036,18 +2352,45 @@ function wrapQuotes(s, defaultStyle, opts) {
|
|
|
2036
2352
|
}
|
|
2037
2353
|
|
|
2038
2354
|
function quote(s) {
|
|
2039
|
-
return String(s)
|
|
2355
|
+
return $replace.call(String(s), /"/g, '"');
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2359
|
+
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2360
|
+
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2361
|
+
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2362
|
+
function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2363
|
+
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2364
|
+
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
2365
|
+
|
|
2366
|
+
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
2367
|
+
function isSymbol(obj) {
|
|
2368
|
+
if (hasShammedSymbols) {
|
|
2369
|
+
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
|
2370
|
+
}
|
|
2371
|
+
if (typeof obj === 'symbol') {
|
|
2372
|
+
return true;
|
|
2373
|
+
}
|
|
2374
|
+
if (!obj || typeof obj !== 'object' || !symToString) {
|
|
2375
|
+
return false;
|
|
2376
|
+
}
|
|
2377
|
+
try {
|
|
2378
|
+
symToString.call(obj);
|
|
2379
|
+
return true;
|
|
2380
|
+
} catch (e) {}
|
|
2381
|
+
return false;
|
|
2040
2382
|
}
|
|
2041
2383
|
|
|
2042
|
-
function
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2384
|
+
function isBigInt(obj) {
|
|
2385
|
+
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
|
|
2386
|
+
return false;
|
|
2387
|
+
}
|
|
2388
|
+
try {
|
|
2389
|
+
bigIntValueOf.call(obj);
|
|
2390
|
+
return true;
|
|
2391
|
+
} catch (e) {}
|
|
2392
|
+
return false;
|
|
2393
|
+
}
|
|
2051
2394
|
|
|
2052
2395
|
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
|
2053
2396
|
function has(obj, key) {
|
|
@@ -2060,7 +2403,7 @@ function toStr(obj) {
|
|
|
2060
2403
|
|
|
2061
2404
|
function nameOf(f) {
|
|
2062
2405
|
if (f.name) { return f.name; }
|
|
2063
|
-
var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
2406
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
2064
2407
|
if (m) { return m[1]; }
|
|
2065
2408
|
return null;
|
|
2066
2409
|
}
|
|
@@ -2105,6 +2448,17 @@ function isWeakMap(x) {
|
|
|
2105
2448
|
return false;
|
|
2106
2449
|
}
|
|
2107
2450
|
|
|
2451
|
+
function isWeakRef(x) {
|
|
2452
|
+
if (!weakRefDeref || !x || typeof x !== 'object') {
|
|
2453
|
+
return false;
|
|
2454
|
+
}
|
|
2455
|
+
try {
|
|
2456
|
+
weakRefDeref.call(x);
|
|
2457
|
+
return true;
|
|
2458
|
+
} catch (e) {}
|
|
2459
|
+
return false;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2108
2462
|
function isSet(x) {
|
|
2109
2463
|
if (!setSize || !x || typeof x !== 'object') {
|
|
2110
2464
|
return false;
|
|
@@ -2149,10 +2503,10 @@ function inspectString(str, opts) {
|
|
|
2149
2503
|
if (str.length > opts.maxStringLength) {
|
|
2150
2504
|
var remaining = str.length - opts.maxStringLength;
|
|
2151
2505
|
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
|
2152
|
-
return inspectString(
|
|
2506
|
+
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
2153
2507
|
}
|
|
2154
2508
|
// eslint-disable-next-line no-control-regex
|
|
2155
|
-
var s =
|
|
2509
|
+
var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
|
2156
2510
|
return wrapQuotes(s, 'single', opts);
|
|
2157
2511
|
}
|
|
2158
2512
|
|
|
@@ -2166,7 +2520,7 @@ function lowbyte(c) {
|
|
|
2166
2520
|
13: 'r'
|
|
2167
2521
|
}[n];
|
|
2168
2522
|
if (x) { return '\\' + x; }
|
|
2169
|
-
return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16)
|
|
2523
|
+
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
|
|
2170
2524
|
}
|
|
2171
2525
|
|
|
2172
2526
|
function markBoxed(str) {
|
|
@@ -2178,7 +2532,7 @@ function weakCollectionOf(type) {
|
|
|
2178
2532
|
}
|
|
2179
2533
|
|
|
2180
2534
|
function collectionOf(type, size, entries, indent) {
|
|
2181
|
-
var joinedEntries = indent ? indentedJoin(entries, indent) :
|
|
2535
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
|
|
2182
2536
|
return type + ' (' + size + ') {' + joinedEntries + '}';
|
|
2183
2537
|
}
|
|
2184
2538
|
|
|
@@ -2196,20 +2550,20 @@ function getIndent(opts, depth) {
|
|
|
2196
2550
|
if (opts.indent === '\t') {
|
|
2197
2551
|
baseIndent = '\t';
|
|
2198
2552
|
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
|
|
2199
|
-
baseIndent = Array(opts.indent + 1)
|
|
2553
|
+
baseIndent = $join.call(Array(opts.indent + 1), ' ');
|
|
2200
2554
|
} else {
|
|
2201
2555
|
return null;
|
|
2202
2556
|
}
|
|
2203
2557
|
return {
|
|
2204
2558
|
base: baseIndent,
|
|
2205
|
-
prev: Array(depth + 1)
|
|
2559
|
+
prev: $join.call(Array(depth + 1), baseIndent)
|
|
2206
2560
|
};
|
|
2207
2561
|
}
|
|
2208
2562
|
|
|
2209
2563
|
function indentedJoin(xs, indent) {
|
|
2210
2564
|
if (xs.length === 0) { return ''; }
|
|
2211
2565
|
var lineJoiner = '\n' + indent.prev + indent.base;
|
|
2212
|
-
return lineJoiner +
|
|
2566
|
+
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
|
|
2213
2567
|
}
|
|
2214
2568
|
|
|
2215
2569
|
function arrObjKeys(obj, inspect) {
|
|
@@ -2221,17 +2575,28 @@ function arrObjKeys(obj, inspect) {
|
|
|
2221
2575
|
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
|
|
2222
2576
|
}
|
|
2223
2577
|
}
|
|
2578
|
+
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
|
2579
|
+
var symMap;
|
|
2580
|
+
if (hasShammedSymbols) {
|
|
2581
|
+
symMap = {};
|
|
2582
|
+
for (var k = 0; k < syms.length; k++) {
|
|
2583
|
+
symMap['$' + syms[k]] = syms[k];
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2224
2587
|
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
2225
2588
|
if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
2226
2589
|
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
2227
|
-
if (
|
|
2590
|
+
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
|
2591
|
+
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
2592
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
2593
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
2228
2594
|
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
|
2229
2595
|
} else {
|
|
2230
2596
|
xs.push(key + ': ' + inspect(obj[key], obj));
|
|
2231
2597
|
}
|
|
2232
2598
|
}
|
|
2233
2599
|
if (typeof gOPS === 'function') {
|
|
2234
|
-
var syms = gOPS(obj);
|
|
2235
2600
|
for (var j = 0; j < syms.length; j++) {
|
|
2236
2601
|
if (isEnumerable.call(obj, syms[j])) {
|
|
2237
2602
|
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
|
@@ -2241,7 +2606,8 @@ function arrObjKeys(obj, inspect) {
|
|
|
2241
2606
|
return xs;
|
|
2242
2607
|
}
|
|
2243
2608
|
|
|
2244
|
-
},
|
|
2609
|
+
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
2610
|
+
},{"./util.inspect":9}],31:[function(require,module,exports){
|
|
2245
2611
|
'use strict';
|
|
2246
2612
|
|
|
2247
2613
|
var replace = String.prototype.replace;
|
|
@@ -2266,7 +2632,7 @@ module.exports = {
|
|
|
2266
2632
|
RFC3986: Format.RFC3986
|
|
2267
2633
|
};
|
|
2268
2634
|
|
|
2269
|
-
},{}],
|
|
2635
|
+
},{}],32:[function(require,module,exports){
|
|
2270
2636
|
'use strict';
|
|
2271
2637
|
|
|
2272
2638
|
var stringify = require('./stringify');
|
|
@@ -2279,7 +2645,7 @@ module.exports = {
|
|
|
2279
2645
|
stringify: stringify
|
|
2280
2646
|
};
|
|
2281
2647
|
|
|
2282
|
-
},{"./formats":
|
|
2648
|
+
},{"./formats":31,"./parse":33,"./stringify":34}],33:[function(require,module,exports){
|
|
2283
2649
|
'use strict';
|
|
2284
2650
|
|
|
2285
2651
|
var utils = require('./utils');
|
|
@@ -2289,15 +2655,18 @@ var isArray = Array.isArray;
|
|
|
2289
2655
|
|
|
2290
2656
|
var defaults = {
|
|
2291
2657
|
allowDots: false,
|
|
2658
|
+
allowEmptyArrays: false,
|
|
2292
2659
|
allowPrototypes: false,
|
|
2293
2660
|
allowSparse: false,
|
|
2294
2661
|
arrayLimit: 20,
|
|
2295
2662
|
charset: 'utf-8',
|
|
2296
2663
|
charsetSentinel: false,
|
|
2297
2664
|
comma: false,
|
|
2665
|
+
decodeDotInKeys: false,
|
|
2298
2666
|
decoder: utils.decode,
|
|
2299
2667
|
delimiter: '&',
|
|
2300
2668
|
depth: 5,
|
|
2669
|
+
duplicates: 'combine',
|
|
2301
2670
|
ignoreQueryPrefix: false,
|
|
2302
2671
|
interpretNumericEntities: false,
|
|
2303
2672
|
parameterLimit: 1000,
|
|
@@ -2331,7 +2700,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
|
2331
2700
|
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
2332
2701
|
|
|
2333
2702
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
2334
|
-
var obj = {};
|
|
2703
|
+
var obj = { __proto__: null };
|
|
2704
|
+
|
|
2335
2705
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
2336
2706
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
2337
2707
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
@@ -2384,9 +2754,10 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
2384
2754
|
val = isArray(val) ? [val] : val;
|
|
2385
2755
|
}
|
|
2386
2756
|
|
|
2387
|
-
|
|
2757
|
+
var existing = has.call(obj, key);
|
|
2758
|
+
if (existing && options.duplicates === 'combine') {
|
|
2388
2759
|
obj[key] = utils.combine(obj[key], val);
|
|
2389
|
-
} else {
|
|
2760
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
2390
2761
|
obj[key] = val;
|
|
2391
2762
|
}
|
|
2392
2763
|
}
|
|
@@ -2402,24 +2773,25 @@ var parseObject = function (chain, val, options, valuesParsed) {
|
|
|
2402
2773
|
var root = chain[i];
|
|
2403
2774
|
|
|
2404
2775
|
if (root === '[]' && options.parseArrays) {
|
|
2405
|
-
obj = [].concat(leaf);
|
|
2776
|
+
obj = options.allowEmptyArrays && leaf === '' ? [] : [].concat(leaf);
|
|
2406
2777
|
} else {
|
|
2407
2778
|
obj = options.plainObjects ? Object.create(null) : {};
|
|
2408
2779
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
2409
|
-
var
|
|
2410
|
-
|
|
2780
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
2781
|
+
var index = parseInt(decodedRoot, 10);
|
|
2782
|
+
if (!options.parseArrays && decodedRoot === '') {
|
|
2411
2783
|
obj = { 0: leaf };
|
|
2412
2784
|
} else if (
|
|
2413
2785
|
!isNaN(index)
|
|
2414
|
-
&& root !==
|
|
2415
|
-
&& String(index) ===
|
|
2786
|
+
&& root !== decodedRoot
|
|
2787
|
+
&& String(index) === decodedRoot
|
|
2416
2788
|
&& index >= 0
|
|
2417
2789
|
&& (options.parseArrays && index <= options.arrayLimit)
|
|
2418
2790
|
) {
|
|
2419
2791
|
obj = [];
|
|
2420
2792
|
obj[index] = leaf;
|
|
2421
|
-
} else if (
|
|
2422
|
-
obj[
|
|
2793
|
+
} else if (decodedRoot !== '__proto__') {
|
|
2794
|
+
obj[decodedRoot] = leaf;
|
|
2423
2795
|
}
|
|
2424
2796
|
}
|
|
2425
2797
|
|
|
@@ -2488,7 +2860,15 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
2488
2860
|
return defaults;
|
|
2489
2861
|
}
|
|
2490
2862
|
|
|
2491
|
-
if (
|
|
2863
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
2864
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
|
|
2868
|
+
throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
|
|
2492
2872
|
throw new TypeError('Decoder has to be a function.');
|
|
2493
2873
|
}
|
|
2494
2874
|
|
|
@@ -2497,18 +2877,29 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
2497
2877
|
}
|
|
2498
2878
|
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
2499
2879
|
|
|
2880
|
+
var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
|
|
2881
|
+
|
|
2882
|
+
if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
|
|
2883
|
+
throw new TypeError('The duplicates option must be either combine, first, or last');
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
2887
|
+
|
|
2500
2888
|
return {
|
|
2501
|
-
allowDots:
|
|
2889
|
+
allowDots: allowDots,
|
|
2890
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
2502
2891
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
2503
2892
|
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
2504
2893
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
2505
2894
|
charset: charset,
|
|
2506
2895
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2507
2896
|
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
2897
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
2508
2898
|
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
2509
2899
|
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
2510
2900
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2511
2901
|
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
2902
|
+
duplicates: duplicates,
|
|
2512
2903
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2513
2904
|
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
2514
2905
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
@@ -2544,7 +2935,7 @@ module.exports = function (str, opts) {
|
|
|
2544
2935
|
return utils.compact(obj);
|
|
2545
2936
|
};
|
|
2546
2937
|
|
|
2547
|
-
},{"./utils":
|
|
2938
|
+
},{"./utils":35}],34:[function(require,module,exports){
|
|
2548
2939
|
'use strict';
|
|
2549
2940
|
|
|
2550
2941
|
var getSideChannel = require('side-channel');
|
|
@@ -2566,7 +2957,6 @@ var arrayPrefixGenerators = {
|
|
|
2566
2957
|
};
|
|
2567
2958
|
|
|
2568
2959
|
var isArray = Array.isArray;
|
|
2569
|
-
var split = String.prototype.split;
|
|
2570
2960
|
var push = Array.prototype.push;
|
|
2571
2961
|
var pushToArray = function (arr, valueOrArray) {
|
|
2572
2962
|
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
@@ -2578,10 +2968,13 @@ var defaultFormat = formats['default'];
|
|
|
2578
2968
|
var defaults = {
|
|
2579
2969
|
addQueryPrefix: false,
|
|
2580
2970
|
allowDots: false,
|
|
2971
|
+
allowEmptyArrays: false,
|
|
2972
|
+
arrayFormat: 'indices',
|
|
2581
2973
|
charset: 'utf-8',
|
|
2582
2974
|
charsetSentinel: false,
|
|
2583
2975
|
delimiter: '&',
|
|
2584
2976
|
encode: true,
|
|
2977
|
+
encodeDotInKeys: false,
|
|
2585
2978
|
encoder: utils.encode,
|
|
2586
2979
|
encodeValuesOnly: false,
|
|
2587
2980
|
format: defaultFormat,
|
|
@@ -2609,8 +3002,11 @@ var stringify = function stringify(
|
|
|
2609
3002
|
object,
|
|
2610
3003
|
prefix,
|
|
2611
3004
|
generateArrayPrefix,
|
|
3005
|
+
commaRoundTrip,
|
|
3006
|
+
allowEmptyArrays,
|
|
2612
3007
|
strictNullHandling,
|
|
2613
3008
|
skipNulls,
|
|
3009
|
+
encodeDotInKeys,
|
|
2614
3010
|
encoder,
|
|
2615
3011
|
filter,
|
|
2616
3012
|
sort,
|
|
@@ -2667,14 +3063,6 @@ var stringify = function stringify(
|
|
|
2667
3063
|
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
2668
3064
|
if (encoder) {
|
|
2669
3065
|
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
|
|
2670
|
-
if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
|
|
2671
|
-
var valuesArray = split.call(String(obj), ',');
|
|
2672
|
-
var valuesJoined = '';
|
|
2673
|
-
for (var i = 0; i < valuesArray.length; ++i) {
|
|
2674
|
-
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
|
|
2675
|
-
}
|
|
2676
|
-
return [formatter(keyValue) + '=' + valuesJoined];
|
|
2677
|
-
}
|
|
2678
3066
|
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
|
|
2679
3067
|
}
|
|
2680
3068
|
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
@@ -2689,6 +3077,9 @@ var stringify = function stringify(
|
|
|
2689
3077
|
var objKeys;
|
|
2690
3078
|
if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
2691
3079
|
// we need to join elements in
|
|
3080
|
+
if (encodeValuesOnly && encoder) {
|
|
3081
|
+
obj = utils.maybeMap(obj, encoder);
|
|
3082
|
+
}
|
|
2692
3083
|
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
2693
3084
|
} else if (isArray(filter)) {
|
|
2694
3085
|
objKeys = filter;
|
|
@@ -2697,6 +3088,14 @@ var stringify = function stringify(
|
|
|
2697
3088
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
2698
3089
|
}
|
|
2699
3090
|
|
|
3091
|
+
var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, '%2E') : prefix;
|
|
3092
|
+
|
|
3093
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
|
|
3094
|
+
|
|
3095
|
+
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
|
|
3096
|
+
return adjustedPrefix + '[]';
|
|
3097
|
+
}
|
|
3098
|
+
|
|
2700
3099
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
2701
3100
|
var key = objKeys[j];
|
|
2702
3101
|
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
@@ -2705,9 +3104,10 @@ var stringify = function stringify(
|
|
|
2705
3104
|
continue;
|
|
2706
3105
|
}
|
|
2707
3106
|
|
|
3107
|
+
var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
|
|
2708
3108
|
var keyPrefix = isArray(obj)
|
|
2709
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(
|
|
2710
|
-
:
|
|
3109
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
|
|
3110
|
+
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
|
|
2711
3111
|
|
|
2712
3112
|
sideChannel.set(object, step);
|
|
2713
3113
|
var valueSideChannel = getSideChannel();
|
|
@@ -2716,9 +3116,12 @@ var stringify = function stringify(
|
|
|
2716
3116
|
value,
|
|
2717
3117
|
keyPrefix,
|
|
2718
3118
|
generateArrayPrefix,
|
|
3119
|
+
commaRoundTrip,
|
|
3120
|
+
allowEmptyArrays,
|
|
2719
3121
|
strictNullHandling,
|
|
2720
3122
|
skipNulls,
|
|
2721
|
-
|
|
3123
|
+
encodeDotInKeys,
|
|
3124
|
+
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
2722
3125
|
filter,
|
|
2723
3126
|
sort,
|
|
2724
3127
|
allowDots,
|
|
@@ -2739,6 +3142,14 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
2739
3142
|
return defaults;
|
|
2740
3143
|
}
|
|
2741
3144
|
|
|
3145
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
3146
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
3150
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
3151
|
+
}
|
|
3152
|
+
|
|
2742
3153
|
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
2743
3154
|
throw new TypeError('Encoder has to be a function.');
|
|
2744
3155
|
}
|
|
@@ -2762,13 +3173,32 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
2762
3173
|
filter = opts.filter;
|
|
2763
3174
|
}
|
|
2764
3175
|
|
|
3176
|
+
var arrayFormat;
|
|
3177
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
3178
|
+
arrayFormat = opts.arrayFormat;
|
|
3179
|
+
} else if ('indices' in opts) {
|
|
3180
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
3181
|
+
} else {
|
|
3182
|
+
arrayFormat = defaults.arrayFormat;
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
3186
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
3190
|
+
|
|
2765
3191
|
return {
|
|
2766
3192
|
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
2767
|
-
allowDots:
|
|
3193
|
+
allowDots: allowDots,
|
|
3194
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
3195
|
+
arrayFormat: arrayFormat,
|
|
2768
3196
|
charset: charset,
|
|
2769
3197
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
3198
|
+
commaRoundTrip: opts.commaRoundTrip,
|
|
2770
3199
|
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
|
2771
3200
|
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
|
3201
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
2772
3202
|
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
|
2773
3203
|
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
2774
3204
|
filter: filter,
|
|
@@ -2802,16 +3232,8 @@ module.exports = function (object, opts) {
|
|
|
2802
3232
|
return '';
|
|
2803
3233
|
}
|
|
2804
3234
|
|
|
2805
|
-
var arrayFormat;
|
|
2806
|
-
|
|
2807
|
-
arrayFormat = opts.arrayFormat;
|
|
2808
|
-
} else if (opts && 'indices' in opts) {
|
|
2809
|
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
2810
|
-
} else {
|
|
2811
|
-
arrayFormat = 'indices';
|
|
2812
|
-
}
|
|
2813
|
-
|
|
2814
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
3235
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
3236
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
2815
3237
|
|
|
2816
3238
|
if (!objKeys) {
|
|
2817
3239
|
objKeys = Object.keys(obj);
|
|
@@ -2832,8 +3254,11 @@ module.exports = function (object, opts) {
|
|
|
2832
3254
|
obj[key],
|
|
2833
3255
|
key,
|
|
2834
3256
|
generateArrayPrefix,
|
|
3257
|
+
commaRoundTrip,
|
|
3258
|
+
options.allowEmptyArrays,
|
|
2835
3259
|
options.strictNullHandling,
|
|
2836
3260
|
options.skipNulls,
|
|
3261
|
+
options.encodeDotInKeys,
|
|
2837
3262
|
options.encode ? options.encoder : null,
|
|
2838
3263
|
options.filter,
|
|
2839
3264
|
options.sort,
|
|
@@ -2863,7 +3288,7 @@ module.exports = function (object, opts) {
|
|
|
2863
3288
|
return joined.length > 0 ? prefix + joined : '';
|
|
2864
3289
|
};
|
|
2865
3290
|
|
|
2866
|
-
},{"./formats":
|
|
3291
|
+
},{"./formats":31,"./utils":35,"side-channel":37}],35:[function(require,module,exports){
|
|
2867
3292
|
'use strict';
|
|
2868
3293
|
|
|
2869
3294
|
var formats = require('./formats');
|
|
@@ -2988,6 +3413,10 @@ var decode = function (str, decoder, charset) {
|
|
|
2988
3413
|
}
|
|
2989
3414
|
};
|
|
2990
3415
|
|
|
3416
|
+
var limit = 1024;
|
|
3417
|
+
|
|
3418
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
3419
|
+
|
|
2991
3420
|
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
2992
3421
|
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
2993
3422
|
// It has been adapted here for stricter adherence to RFC 3986
|
|
@@ -3009,45 +3438,54 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
|
3009
3438
|
}
|
|
3010
3439
|
|
|
3011
3440
|
var out = '';
|
|
3012
|
-
for (var
|
|
3013
|
-
var
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3441
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
3442
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
3443
|
+
var arr = [];
|
|
3444
|
+
|
|
3445
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
3446
|
+
var c = segment.charCodeAt(i);
|
|
3447
|
+
if (
|
|
3448
|
+
c === 0x2D // -
|
|
3449
|
+
|| c === 0x2E // .
|
|
3450
|
+
|| c === 0x5F // _
|
|
3451
|
+
|| c === 0x7E // ~
|
|
3452
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
3453
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
3454
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
3455
|
+
|| (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
3456
|
+
) {
|
|
3457
|
+
arr[arr.length] = segment.charAt(i);
|
|
3458
|
+
continue;
|
|
3459
|
+
}
|
|
3028
3460
|
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3461
|
+
if (c < 0x80) {
|
|
3462
|
+
arr[arr.length] = hexTable[c];
|
|
3463
|
+
continue;
|
|
3464
|
+
}
|
|
3033
3465
|
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3466
|
+
if (c < 0x800) {
|
|
3467
|
+
arr[arr.length] = hexTable[0xC0 | (c >> 6)]
|
|
3468
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
3469
|
+
continue;
|
|
3470
|
+
}
|
|
3038
3471
|
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3472
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
3473
|
+
arr[arr.length] = hexTable[0xE0 | (c >> 12)]
|
|
3474
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
3475
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
3476
|
+
continue;
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
i += 1;
|
|
3480
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
|
|
3481
|
+
|
|
3482
|
+
arr[arr.length] = hexTable[0xF0 | (c >> 18)]
|
|
3483
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
3484
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
3485
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
3042
3486
|
}
|
|
3043
3487
|
|
|
3044
|
-
|
|
3045
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
3046
|
-
/* eslint operator-linebreak: [2, "before"] */
|
|
3047
|
-
out += hexTable[0xF0 | (c >> 18)]
|
|
3048
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
3049
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
3050
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
3488
|
+
out += arr.join('');
|
|
3051
3489
|
}
|
|
3052
3490
|
|
|
3053
3491
|
return out;
|
|
@@ -3117,14 +3555,58 @@ module.exports = {
|
|
|
3117
3555
|
merge: merge
|
|
3118
3556
|
};
|
|
3119
3557
|
|
|
3120
|
-
},{"./formats":
|
|
3558
|
+
},{"./formats":31}],36:[function(require,module,exports){
|
|
3559
|
+
'use strict';
|
|
3560
|
+
|
|
3561
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
3562
|
+
var define = require('define-data-property');
|
|
3563
|
+
var hasDescriptors = require('has-property-descriptors')();
|
|
3564
|
+
var gOPD = require('gopd');
|
|
3565
|
+
|
|
3566
|
+
var $TypeError = require('es-errors/type');
|
|
3567
|
+
var $floor = GetIntrinsic('%Math.floor%');
|
|
3568
|
+
|
|
3569
|
+
/** @type {import('.')} */
|
|
3570
|
+
module.exports = function setFunctionLength(fn, length) {
|
|
3571
|
+
if (typeof fn !== 'function') {
|
|
3572
|
+
throw new $TypeError('`fn` is not a function');
|
|
3573
|
+
}
|
|
3574
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
|
|
3575
|
+
throw new $TypeError('`length` must be a positive 32-bit integer');
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3578
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
3579
|
+
|
|
3580
|
+
var functionLengthIsConfigurable = true;
|
|
3581
|
+
var functionLengthIsWritable = true;
|
|
3582
|
+
if ('length' in fn && gOPD) {
|
|
3583
|
+
var desc = gOPD(fn, 'length');
|
|
3584
|
+
if (desc && !desc.configurable) {
|
|
3585
|
+
functionLengthIsConfigurable = false;
|
|
3586
|
+
}
|
|
3587
|
+
if (desc && !desc.writable) {
|
|
3588
|
+
functionLengthIsWritable = false;
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
|
|
3592
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
3593
|
+
if (hasDescriptors) {
|
|
3594
|
+
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
|
3595
|
+
} else {
|
|
3596
|
+
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
|
3597
|
+
}
|
|
3598
|
+
}
|
|
3599
|
+
return fn;
|
|
3600
|
+
};
|
|
3601
|
+
|
|
3602
|
+
},{"define-data-property":12,"es-errors/type":19,"get-intrinsic":23,"gopd":24,"has-property-descriptors":25}],37:[function(require,module,exports){
|
|
3121
3603
|
'use strict';
|
|
3122
3604
|
|
|
3123
3605
|
var GetIntrinsic = require('get-intrinsic');
|
|
3124
3606
|
var callBound = require('call-bind/callBound');
|
|
3125
3607
|
var inspect = require('object-inspect');
|
|
3126
3608
|
|
|
3127
|
-
var $TypeError =
|
|
3609
|
+
var $TypeError = require('es-errors/type');
|
|
3128
3610
|
var $WeakMap = GetIntrinsic('%WeakMap%', true);
|
|
3129
3611
|
var $Map = GetIntrinsic('%Map%', true);
|
|
3130
3612
|
|
|
@@ -3136,49 +3618,58 @@ var $mapSet = callBound('Map.prototype.set', true);
|
|
|
3136
3618
|
var $mapHas = callBound('Map.prototype.has', true);
|
|
3137
3619
|
|
|
3138
3620
|
/*
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
* used nodes can be accessed relatively quickly.
|
|
3145
|
-
*/
|
|
3621
|
+
* This function traverses the list returning the node corresponding to the given key.
|
|
3622
|
+
*
|
|
3623
|
+
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
|
|
3624
|
+
*/
|
|
3625
|
+
/** @type {import('.').listGetNode} */
|
|
3146
3626
|
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
|
|
3147
|
-
|
|
3627
|
+
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
|
|
3628
|
+
var prev = list;
|
|
3629
|
+
/** @type {(typeof list)['next']} */
|
|
3630
|
+
var curr;
|
|
3631
|
+
for (; (curr = prev.next) !== null; prev = curr) {
|
|
3148
3632
|
if (curr.key === key) {
|
|
3149
3633
|
prev.next = curr.next;
|
|
3150
|
-
|
|
3634
|
+
// eslint-disable-next-line no-extra-parens
|
|
3635
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
|
|
3151
3636
|
list.next = curr; // eslint-disable-line no-param-reassign
|
|
3152
3637
|
return curr;
|
|
3153
3638
|
}
|
|
3154
3639
|
}
|
|
3155
3640
|
};
|
|
3156
3641
|
|
|
3642
|
+
/** @type {import('.').listGet} */
|
|
3157
3643
|
var listGet = function (objects, key) {
|
|
3158
3644
|
var node = listGetNode(objects, key);
|
|
3159
3645
|
return node && node.value;
|
|
3160
3646
|
};
|
|
3647
|
+
/** @type {import('.').listSet} */
|
|
3161
3648
|
var listSet = function (objects, key, value) {
|
|
3162
3649
|
var node = listGetNode(objects, key);
|
|
3163
3650
|
if (node) {
|
|
3164
3651
|
node.value = value;
|
|
3165
3652
|
} else {
|
|
3166
3653
|
// Prepend the new node to the beginning of the list
|
|
3167
|
-
objects.next = { // eslint-disable-line no-param-reassign
|
|
3654
|
+
objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
|
|
3168
3655
|
key: key,
|
|
3169
3656
|
next: objects.next,
|
|
3170
3657
|
value: value
|
|
3171
|
-
};
|
|
3658
|
+
});
|
|
3172
3659
|
}
|
|
3173
3660
|
};
|
|
3661
|
+
/** @type {import('.').listHas} */
|
|
3174
3662
|
var listHas = function (objects, key) {
|
|
3175
3663
|
return !!listGetNode(objects, key);
|
|
3176
3664
|
};
|
|
3177
3665
|
|
|
3666
|
+
/** @type {import('.')} */
|
|
3178
3667
|
module.exports = function getSideChannel() {
|
|
3179
|
-
var $wm;
|
|
3180
|
-
var $m;
|
|
3181
|
-
var $o;
|
|
3668
|
+
/** @type {WeakMap<object, unknown>} */ var $wm;
|
|
3669
|
+
/** @type {Map<object, unknown>} */ var $m;
|
|
3670
|
+
/** @type {import('.').RootNode<unknown>} */ var $o;
|
|
3671
|
+
|
|
3672
|
+
/** @type {import('.').Channel} */
|
|
3182
3673
|
var channel = {
|
|
3183
3674
|
assert: function (key) {
|
|
3184
3675
|
if (!channel.has(key)) {
|
|
@@ -3229,11 +3720,7 @@ module.exports = function getSideChannel() {
|
|
|
3229
3720
|
$mapSet($m, key, value);
|
|
3230
3721
|
} else {
|
|
3231
3722
|
if (!$o) {
|
|
3232
|
-
|
|
3233
|
-
* Initialize the linked list as an empty node, so that we don't have
|
|
3234
|
-
* to special-case handling of the first node: we can always refer to
|
|
3235
|
-
* it as (previous node).next, instead of something like (list).head
|
|
3236
|
-
*/
|
|
3723
|
+
// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
|
|
3237
3724
|
$o = { key: {}, next: null };
|
|
3238
3725
|
}
|
|
3239
3726
|
listSet($o, key, value);
|
|
@@ -3243,5 +3730,5 @@ module.exports = function getSideChannel() {
|
|
|
3243
3730
|
return channel;
|
|
3244
3731
|
};
|
|
3245
3732
|
|
|
3246
|
-
},{"call-bind/callBound":10,"get-intrinsic":
|
|
3733
|
+
},{"call-bind/callBound":10,"es-errors/type":19,"get-intrinsic":23,"object-inspect":30}]},{},[4])(4)
|
|
3247
3734
|
});
|