qs 6.11.2 → 6.11.4
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 +11 -0
- package/README.md +9 -3
- package/dist/qs.js +684 -190
- package/lib/parse.js +4 -4
- package/lib/utils.js +7 -7
- package/package.json +1 -1
- package/test/parse.js +9 -0
- package/test/stringify.js +6 -0
package/dist/qs.js
CHANGED
|
@@ -91,7 +91,7 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
91
91
|
var obj = { __proto__: null };
|
|
92
92
|
|
|
93
93
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
94
|
-
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
94
|
+
var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;
|
|
95
95
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
96
96
|
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
97
97
|
var i;
|
|
@@ -216,7 +216,7 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
keys.
|
|
219
|
+
keys[keys.length] = parent;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
// Loop through children appending to the array until we hit depth
|
|
@@ -229,13 +229,13 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars
|
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
keys.
|
|
232
|
+
keys[keys.length] = segment[1];
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
// If there's a remainder, just add whatever is left
|
|
236
236
|
|
|
237
237
|
if (segment) {
|
|
238
|
-
keys.
|
|
238
|
+
keys[keys.length] = '[' + key.slice(segment.index) + ']';
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
return parseObject(keys, val, options, valuesParsed);
|
|
@@ -624,7 +624,7 @@ module.exports = function (object, opts) {
|
|
|
624
624
|
return joined.length > 0 ? prefix + joined : '';
|
|
625
625
|
};
|
|
626
626
|
|
|
627
|
-
},{"./formats":1,"./utils":5,"side-channel":
|
|
627
|
+
},{"./formats":1,"./utils":5,"side-channel":46}],5:[function(require,module,exports){
|
|
628
628
|
'use strict';
|
|
629
629
|
|
|
630
630
|
var formats = require('./formats');
|
|
@@ -635,7 +635,7 @@ var isArray = Array.isArray;
|
|
|
635
635
|
var hexTable = (function () {
|
|
636
636
|
var array = [];
|
|
637
637
|
for (var i = 0; i < 256; ++i) {
|
|
638
|
-
array.
|
|
638
|
+
array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
|
|
639
639
|
}
|
|
640
640
|
|
|
641
641
|
return array;
|
|
@@ -651,7 +651,7 @@ var compactQueue = function compactQueue(queue) {
|
|
|
651
651
|
|
|
652
652
|
for (var j = 0; j < obj.length; ++j) {
|
|
653
653
|
if (typeof obj[j] !== 'undefined') {
|
|
654
|
-
compacted.
|
|
654
|
+
compacted[compacted.length] = obj[j];
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
657
|
|
|
@@ -679,7 +679,7 @@ var merge = function merge(target, source, options) {
|
|
|
679
679
|
|
|
680
680
|
if (typeof source !== 'object') {
|
|
681
681
|
if (isArray(target)) {
|
|
682
|
-
target.
|
|
682
|
+
target[target.length] = source;
|
|
683
683
|
} else if (target && typeof target === 'object') {
|
|
684
684
|
if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
|
|
685
685
|
target[source] = true;
|
|
@@ -707,7 +707,7 @@ var merge = function merge(target, source, options) {
|
|
|
707
707
|
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
708
708
|
target[i] = merge(targetItem, item, options);
|
|
709
709
|
} else {
|
|
710
|
-
target.
|
|
710
|
+
target[target.length] = item;
|
|
711
711
|
}
|
|
712
712
|
} else {
|
|
713
713
|
target[i] = item;
|
|
@@ -827,8 +827,8 @@ var compact = function compact(value) {
|
|
|
827
827
|
var key = keys[j];
|
|
828
828
|
var val = obj[key];
|
|
829
829
|
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
830
|
-
queue.
|
|
831
|
-
refs.
|
|
830
|
+
queue[queue.length] = { obj: obj, prop: key };
|
|
831
|
+
refs[refs.length] = val;
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
}
|
|
@@ -858,7 +858,7 @@ var maybeMap = function maybeMap(val, fn) {
|
|
|
858
858
|
if (isArray(val)) {
|
|
859
859
|
var mapped = [];
|
|
860
860
|
for (var i = 0; i < val.length; i += 1) {
|
|
861
|
-
mapped.
|
|
861
|
+
mapped[mapped.length] = fn(val[i]);
|
|
862
862
|
}
|
|
863
863
|
return mapped;
|
|
864
864
|
}
|
|
@@ -883,112 +883,242 @@ module.exports = {
|
|
|
883
883
|
},{}],7:[function(require,module,exports){
|
|
884
884
|
'use strict';
|
|
885
885
|
|
|
886
|
+
var bind = require('function-bind');
|
|
887
|
+
|
|
888
|
+
var $apply = require('./functionApply');
|
|
889
|
+
var $call = require('./functionCall');
|
|
890
|
+
var $reflectApply = require('./reflectApply');
|
|
891
|
+
|
|
892
|
+
/** @type {import('./actualApply')} */
|
|
893
|
+
module.exports = $reflectApply || bind.call($call, $apply);
|
|
894
|
+
|
|
895
|
+
},{"./functionApply":8,"./functionCall":9,"./reflectApply":11,"function-bind":24}],8:[function(require,module,exports){
|
|
896
|
+
'use strict';
|
|
897
|
+
|
|
898
|
+
/** @type {import('./functionApply')} */
|
|
899
|
+
module.exports = Function.prototype.apply;
|
|
900
|
+
|
|
901
|
+
},{}],9:[function(require,module,exports){
|
|
902
|
+
'use strict';
|
|
903
|
+
|
|
904
|
+
/** @type {import('./functionCall')} */
|
|
905
|
+
module.exports = Function.prototype.call;
|
|
906
|
+
|
|
907
|
+
},{}],10:[function(require,module,exports){
|
|
908
|
+
'use strict';
|
|
909
|
+
|
|
910
|
+
var bind = require('function-bind');
|
|
911
|
+
var $TypeError = require('es-errors/type');
|
|
912
|
+
|
|
913
|
+
var $call = require('./functionCall');
|
|
914
|
+
var $actualApply = require('./actualApply');
|
|
915
|
+
|
|
916
|
+
/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
|
|
917
|
+
module.exports = function callBindBasic(args) {
|
|
918
|
+
if (args.length < 1 || typeof args[0] !== 'function') {
|
|
919
|
+
throw new $TypeError('a function is required');
|
|
920
|
+
}
|
|
921
|
+
return $actualApply(bind, $call, args);
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
},{"./actualApply":7,"./functionCall":9,"es-errors/type":20,"function-bind":24}],11:[function(require,module,exports){
|
|
925
|
+
'use strict';
|
|
926
|
+
|
|
927
|
+
/** @type {import('./reflectApply')} */
|
|
928
|
+
module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
|
|
929
|
+
|
|
930
|
+
},{}],12:[function(require,module,exports){
|
|
931
|
+
'use strict';
|
|
932
|
+
|
|
886
933
|
var GetIntrinsic = require('get-intrinsic');
|
|
887
934
|
|
|
888
|
-
var
|
|
935
|
+
var callBindBasic = require('call-bind-apply-helpers');
|
|
889
936
|
|
|
890
|
-
|
|
937
|
+
/** @type {(thisArg: string, searchString: string, position?: number) => number} */
|
|
938
|
+
var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
|
|
891
939
|
|
|
940
|
+
/** @type {import('.')} */
|
|
892
941
|
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
893
|
-
|
|
942
|
+
/* eslint no-extra-parens: 0 */
|
|
943
|
+
|
|
944
|
+
var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
|
|
894
945
|
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
895
|
-
return
|
|
946
|
+
return callBindBasic(/** @type {const} */ ([intrinsic]));
|
|
896
947
|
}
|
|
897
948
|
return intrinsic;
|
|
898
949
|
};
|
|
899
950
|
|
|
900
|
-
},{"
|
|
951
|
+
},{"call-bind-apply-helpers":10,"get-intrinsic":25}],13:[function(require,module,exports){
|
|
901
952
|
'use strict';
|
|
902
953
|
|
|
903
|
-
var
|
|
904
|
-
var
|
|
954
|
+
var callBind = require('call-bind-apply-helpers');
|
|
955
|
+
var gOPD = require('gopd');
|
|
956
|
+
|
|
957
|
+
var hasProtoAccessor;
|
|
958
|
+
try {
|
|
959
|
+
// eslint-disable-next-line no-extra-parens, no-proto
|
|
960
|
+
hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
|
|
961
|
+
} catch (e) {
|
|
962
|
+
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
|
|
963
|
+
throw e;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
// eslint-disable-next-line no-extra-parens
|
|
968
|
+
var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
|
|
905
969
|
|
|
906
|
-
var $
|
|
907
|
-
var $
|
|
908
|
-
|
|
970
|
+
var $Object = Object;
|
|
971
|
+
var $getPrototypeOf = $Object.getPrototypeOf;
|
|
972
|
+
|
|
973
|
+
/** @type {import('./get')} */
|
|
974
|
+
module.exports = desc && typeof desc.get === 'function'
|
|
975
|
+
? callBind([desc.get])
|
|
976
|
+
: typeof $getPrototypeOf === 'function'
|
|
977
|
+
? /** @type {import('./get')} */ function getDunder(value) {
|
|
978
|
+
// eslint-disable-next-line eqeqeq
|
|
979
|
+
return $getPrototypeOf(value == null ? value : $Object(value));
|
|
980
|
+
}
|
|
981
|
+
: false;
|
|
909
982
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
var $max = GetIntrinsic('%Math.max%');
|
|
983
|
+
},{"call-bind-apply-helpers":10,"gopd":30}],14:[function(require,module,exports){
|
|
984
|
+
'use strict';
|
|
913
985
|
|
|
986
|
+
/** @type {import('.')} */
|
|
987
|
+
var $defineProperty = Object.defineProperty || false;
|
|
914
988
|
if ($defineProperty) {
|
|
915
989
|
try {
|
|
916
990
|
$defineProperty({}, 'a', { value: 1 });
|
|
917
991
|
} catch (e) {
|
|
918
992
|
// IE 8 has a broken defineProperty
|
|
919
|
-
$defineProperty =
|
|
993
|
+
$defineProperty = false;
|
|
920
994
|
}
|
|
921
995
|
}
|
|
922
996
|
|
|
923
|
-
module.exports =
|
|
924
|
-
var func = $reflectApply(bind, $call, arguments);
|
|
925
|
-
if ($gOPD && $defineProperty) {
|
|
926
|
-
var desc = $gOPD(func, 'length');
|
|
927
|
-
if (desc.configurable) {
|
|
928
|
-
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
|
929
|
-
$defineProperty(
|
|
930
|
-
func,
|
|
931
|
-
'length',
|
|
932
|
-
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
|
933
|
-
);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
return func;
|
|
937
|
-
};
|
|
997
|
+
module.exports = $defineProperty;
|
|
938
998
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
};
|
|
999
|
+
},{}],15:[function(require,module,exports){
|
|
1000
|
+
'use strict';
|
|
942
1001
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
} else {
|
|
946
|
-
module.exports.apply = applyBind;
|
|
947
|
-
}
|
|
1002
|
+
/** @type {import('./eval')} */
|
|
1003
|
+
module.exports = EvalError;
|
|
948
1004
|
|
|
949
|
-
},{
|
|
1005
|
+
},{}],16:[function(require,module,exports){
|
|
1006
|
+
'use strict';
|
|
1007
|
+
|
|
1008
|
+
/** @type {import('.')} */
|
|
1009
|
+
module.exports = Error;
|
|
1010
|
+
|
|
1011
|
+
},{}],17:[function(require,module,exports){
|
|
1012
|
+
'use strict';
|
|
1013
|
+
|
|
1014
|
+
/** @type {import('./range')} */
|
|
1015
|
+
module.exports = RangeError;
|
|
1016
|
+
|
|
1017
|
+
},{}],18:[function(require,module,exports){
|
|
1018
|
+
'use strict';
|
|
1019
|
+
|
|
1020
|
+
/** @type {import('./ref')} */
|
|
1021
|
+
module.exports = ReferenceError;
|
|
1022
|
+
|
|
1023
|
+
},{}],19:[function(require,module,exports){
|
|
1024
|
+
'use strict';
|
|
1025
|
+
|
|
1026
|
+
/** @type {import('./syntax')} */
|
|
1027
|
+
module.exports = SyntaxError;
|
|
1028
|
+
|
|
1029
|
+
},{}],20:[function(require,module,exports){
|
|
1030
|
+
'use strict';
|
|
1031
|
+
|
|
1032
|
+
/** @type {import('./type')} */
|
|
1033
|
+
module.exports = TypeError;
|
|
1034
|
+
|
|
1035
|
+
},{}],21:[function(require,module,exports){
|
|
1036
|
+
'use strict';
|
|
1037
|
+
|
|
1038
|
+
/** @type {import('./uri')} */
|
|
1039
|
+
module.exports = URIError;
|
|
1040
|
+
|
|
1041
|
+
},{}],22:[function(require,module,exports){
|
|
1042
|
+
'use strict';
|
|
1043
|
+
|
|
1044
|
+
/** @type {import('.')} */
|
|
1045
|
+
module.exports = Object;
|
|
1046
|
+
|
|
1047
|
+
},{}],23:[function(require,module,exports){
|
|
950
1048
|
'use strict';
|
|
951
1049
|
|
|
952
1050
|
/* eslint no-invalid-this: 1 */
|
|
953
1051
|
|
|
954
1052
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
955
|
-
var slice = Array.prototype.slice;
|
|
956
1053
|
var toStr = Object.prototype.toString;
|
|
1054
|
+
var max = Math.max;
|
|
957
1055
|
var funcType = '[object Function]';
|
|
958
1056
|
|
|
1057
|
+
var concatty = function concatty(a, b) {
|
|
1058
|
+
var arr = [];
|
|
1059
|
+
|
|
1060
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
1061
|
+
arr[i] = a[i];
|
|
1062
|
+
}
|
|
1063
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
1064
|
+
arr[j + a.length] = b[j];
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
return arr;
|
|
1068
|
+
};
|
|
1069
|
+
|
|
1070
|
+
var slicy = function slicy(arrLike, offset) {
|
|
1071
|
+
var arr = [];
|
|
1072
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
1073
|
+
arr[j] = arrLike[i];
|
|
1074
|
+
}
|
|
1075
|
+
return arr;
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
var joiny = function (arr, joiner) {
|
|
1079
|
+
var str = '';
|
|
1080
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
1081
|
+
str += arr[i];
|
|
1082
|
+
if (i + 1 < arr.length) {
|
|
1083
|
+
str += joiner;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return str;
|
|
1087
|
+
};
|
|
1088
|
+
|
|
959
1089
|
module.exports = function bind(that) {
|
|
960
1090
|
var target = this;
|
|
961
|
-
if (typeof target !== 'function' || toStr.
|
|
1091
|
+
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
|
|
962
1092
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
963
1093
|
}
|
|
964
|
-
var args =
|
|
1094
|
+
var args = slicy(arguments, 1);
|
|
965
1095
|
|
|
966
1096
|
var bound;
|
|
967
1097
|
var binder = function () {
|
|
968
1098
|
if (this instanceof bound) {
|
|
969
1099
|
var result = target.apply(
|
|
970
1100
|
this,
|
|
971
|
-
args
|
|
1101
|
+
concatty(args, arguments)
|
|
972
1102
|
);
|
|
973
1103
|
if (Object(result) === result) {
|
|
974
1104
|
return result;
|
|
975
1105
|
}
|
|
976
1106
|
return this;
|
|
977
|
-
} else {
|
|
978
|
-
return target.apply(
|
|
979
|
-
that,
|
|
980
|
-
args.concat(slice.call(arguments))
|
|
981
|
-
);
|
|
982
1107
|
}
|
|
1108
|
+
return target.apply(
|
|
1109
|
+
that,
|
|
1110
|
+
concatty(args, arguments)
|
|
1111
|
+
);
|
|
1112
|
+
|
|
983
1113
|
};
|
|
984
1114
|
|
|
985
|
-
var boundLength =
|
|
1115
|
+
var boundLength = max(0, target.length - args.length);
|
|
986
1116
|
var boundArgs = [];
|
|
987
1117
|
for (var i = 0; i < boundLength; i++) {
|
|
988
|
-
boundArgs
|
|
1118
|
+
boundArgs[i] = '$' + i;
|
|
989
1119
|
}
|
|
990
1120
|
|
|
991
|
-
bound = Function('binder', 'return function (' + boundArgs
|
|
1121
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
992
1122
|
|
|
993
1123
|
if (target.prototype) {
|
|
994
1124
|
var Empty = function Empty() {};
|
|
@@ -1000,21 +1130,37 @@ module.exports = function bind(that) {
|
|
|
1000
1130
|
return bound;
|
|
1001
1131
|
};
|
|
1002
1132
|
|
|
1003
|
-
},{}],
|
|
1133
|
+
},{}],24:[function(require,module,exports){
|
|
1004
1134
|
'use strict';
|
|
1005
1135
|
|
|
1006
1136
|
var implementation = require('./implementation');
|
|
1007
1137
|
|
|
1008
1138
|
module.exports = Function.prototype.bind || implementation;
|
|
1009
1139
|
|
|
1010
|
-
},{"./implementation":
|
|
1140
|
+
},{"./implementation":23}],25:[function(require,module,exports){
|
|
1011
1141
|
'use strict';
|
|
1012
1142
|
|
|
1013
1143
|
var undefined;
|
|
1014
1144
|
|
|
1015
|
-
var $
|
|
1145
|
+
var $Object = require('es-object-atoms');
|
|
1146
|
+
|
|
1147
|
+
var $Error = require('es-errors');
|
|
1148
|
+
var $EvalError = require('es-errors/eval');
|
|
1149
|
+
var $RangeError = require('es-errors/range');
|
|
1150
|
+
var $ReferenceError = require('es-errors/ref');
|
|
1151
|
+
var $SyntaxError = require('es-errors/syntax');
|
|
1152
|
+
var $TypeError = require('es-errors/type');
|
|
1153
|
+
var $URIError = require('es-errors/uri');
|
|
1154
|
+
|
|
1155
|
+
var abs = require('math-intrinsics/abs');
|
|
1156
|
+
var floor = require('math-intrinsics/floor');
|
|
1157
|
+
var max = require('math-intrinsics/max');
|
|
1158
|
+
var min = require('math-intrinsics/min');
|
|
1159
|
+
var pow = require('math-intrinsics/pow');
|
|
1160
|
+
var round = require('math-intrinsics/round');
|
|
1161
|
+
var sign = require('math-intrinsics/sign');
|
|
1162
|
+
|
|
1016
1163
|
var $Function = Function;
|
|
1017
|
-
var $TypeError = TypeError;
|
|
1018
1164
|
|
|
1019
1165
|
// eslint-disable-next-line consistent-return
|
|
1020
1166
|
var getEvalledConstructor = function (expressionSyntax) {
|
|
@@ -1023,14 +1169,8 @@ var getEvalledConstructor = function (expressionSyntax) {
|
|
|
1023
1169
|
} catch (e) {}
|
|
1024
1170
|
};
|
|
1025
1171
|
|
|
1026
|
-
var $gOPD =
|
|
1027
|
-
|
|
1028
|
-
try {
|
|
1029
|
-
$gOPD({}, '');
|
|
1030
|
-
} catch (e) {
|
|
1031
|
-
$gOPD = null; // this is IE 8, which has a broken gOPD
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1172
|
+
var $gOPD = require('gopd');
|
|
1173
|
+
var $defineProperty = require('es-define-property');
|
|
1034
1174
|
|
|
1035
1175
|
var throwTypeError = function () {
|
|
1036
1176
|
throw new $TypeError();
|
|
@@ -1053,19 +1193,20 @@ var ThrowTypeError = $gOPD
|
|
|
1053
1193
|
: throwTypeError;
|
|
1054
1194
|
|
|
1055
1195
|
var hasSymbols = require('has-symbols')();
|
|
1056
|
-
var hasProto = require('has-proto')();
|
|
1057
1196
|
|
|
1058
|
-
var getProto =
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
);
|
|
1197
|
+
var getProto = require('get-proto');
|
|
1198
|
+
var $ObjectGPO = require('get-proto/Object.getPrototypeOf');
|
|
1199
|
+
var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');
|
|
1200
|
+
|
|
1201
|
+
var $apply = require('call-bind-apply-helpers/functionApply');
|
|
1202
|
+
var $call = require('call-bind-apply-helpers/functionCall');
|
|
1063
1203
|
|
|
1064
1204
|
var needsEval = {};
|
|
1065
1205
|
|
|
1066
1206
|
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
|
|
1067
1207
|
|
|
1068
1208
|
var INTRINSICS = {
|
|
1209
|
+
__proto__: null,
|
|
1069
1210
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
|
1070
1211
|
'%Array%': Array,
|
|
1071
1212
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
|
@@ -1086,9 +1227,10 @@ var INTRINSICS = {
|
|
|
1086
1227
|
'%decodeURIComponent%': decodeURIComponent,
|
|
1087
1228
|
'%encodeURI%': encodeURI,
|
|
1088
1229
|
'%encodeURIComponent%': encodeURIComponent,
|
|
1089
|
-
'%Error%': Error,
|
|
1230
|
+
'%Error%': $Error,
|
|
1090
1231
|
'%eval%': eval, // eslint-disable-line no-eval
|
|
1091
|
-
'%EvalError%': EvalError,
|
|
1232
|
+
'%EvalError%': $EvalError,
|
|
1233
|
+
'%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,
|
|
1092
1234
|
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
|
1093
1235
|
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
|
1094
1236
|
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
|
|
@@ -1105,13 +1247,14 @@ var INTRINSICS = {
|
|
|
1105
1247
|
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
1106
1248
|
'%Math%': Math,
|
|
1107
1249
|
'%Number%': Number,
|
|
1108
|
-
'%Object%': Object,
|
|
1250
|
+
'%Object%': $Object,
|
|
1251
|
+
'%Object.getOwnPropertyDescriptor%': $gOPD,
|
|
1109
1252
|
'%parseFloat%': parseFloat,
|
|
1110
1253
|
'%parseInt%': parseInt,
|
|
1111
1254
|
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
|
1112
1255
|
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
|
1113
|
-
'%RangeError%': RangeError,
|
|
1114
|
-
'%ReferenceError%': ReferenceError,
|
|
1256
|
+
'%RangeError%': $RangeError,
|
|
1257
|
+
'%ReferenceError%': $ReferenceError,
|
|
1115
1258
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
|
1116
1259
|
'%RegExp%': RegExp,
|
|
1117
1260
|
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
|
@@ -1128,10 +1271,23 @@ var INTRINSICS = {
|
|
|
1128
1271
|
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
|
1129
1272
|
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
|
1130
1273
|
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
|
1131
|
-
'%URIError%': URIError,
|
|
1274
|
+
'%URIError%': $URIError,
|
|
1132
1275
|
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
|
1133
1276
|
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
|
1134
|
-
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
|
|
1277
|
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
|
|
1278
|
+
|
|
1279
|
+
'%Function.prototype.call%': $call,
|
|
1280
|
+
'%Function.prototype.apply%': $apply,
|
|
1281
|
+
'%Object.defineProperty%': $defineProperty,
|
|
1282
|
+
'%Object.getPrototypeOf%': $ObjectGPO,
|
|
1283
|
+
'%Math.abs%': abs,
|
|
1284
|
+
'%Math.floor%': floor,
|
|
1285
|
+
'%Math.max%': max,
|
|
1286
|
+
'%Math.min%': min,
|
|
1287
|
+
'%Math.pow%': pow,
|
|
1288
|
+
'%Math.round%': round,
|
|
1289
|
+
'%Math.sign%': sign,
|
|
1290
|
+
'%Reflect.getPrototypeOf%': $ReflectGPO
|
|
1135
1291
|
};
|
|
1136
1292
|
|
|
1137
1293
|
if (getProto) {
|
|
@@ -1170,6 +1326,7 @@ var doEval = function doEval(name) {
|
|
|
1170
1326
|
};
|
|
1171
1327
|
|
|
1172
1328
|
var LEGACY_ALIASES = {
|
|
1329
|
+
__proto__: null,
|
|
1173
1330
|
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
1174
1331
|
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
1175
1332
|
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
@@ -1224,12 +1381,12 @@ var LEGACY_ALIASES = {
|
|
|
1224
1381
|
};
|
|
1225
1382
|
|
|
1226
1383
|
var bind = require('function-bind');
|
|
1227
|
-
var hasOwn = require('
|
|
1228
|
-
var $concat = bind.call(
|
|
1229
|
-
var $spliceApply = bind.call(
|
|
1230
|
-
var $replace = bind.call(
|
|
1231
|
-
var $strSlice = bind.call(
|
|
1232
|
-
var $exec = bind.call(
|
|
1384
|
+
var hasOwn = require('hasown');
|
|
1385
|
+
var $concat = bind.call($call, Array.prototype.concat);
|
|
1386
|
+
var $spliceApply = bind.call($apply, Array.prototype.splice);
|
|
1387
|
+
var $replace = bind.call($call, String.prototype.replace);
|
|
1388
|
+
var $strSlice = bind.call($call, String.prototype.slice);
|
|
1389
|
+
var $exec = bind.call($call, RegExp.prototype.exec);
|
|
1233
1390
|
|
|
1234
1391
|
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
1235
1392
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
@@ -1360,25 +1517,79 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
1360
1517
|
return value;
|
|
1361
1518
|
};
|
|
1362
1519
|
|
|
1363
|
-
},{"
|
|
1520
|
+
},{"call-bind-apply-helpers/functionApply":8,"call-bind-apply-helpers/functionCall":9,"es-define-property":14,"es-errors":16,"es-errors/eval":15,"es-errors/range":17,"es-errors/ref":18,"es-errors/syntax":19,"es-errors/type":20,"es-errors/uri":21,"es-object-atoms":22,"function-bind":24,"get-proto":28,"get-proto/Object.getPrototypeOf":26,"get-proto/Reflect.getPrototypeOf":27,"gopd":30,"has-symbols":31,"hasown":33,"math-intrinsics/abs":34,"math-intrinsics/floor":35,"math-intrinsics/max":37,"math-intrinsics/min":38,"math-intrinsics/pow":39,"math-intrinsics/round":40,"math-intrinsics/sign":41}],26:[function(require,module,exports){
|
|
1364
1521
|
'use strict';
|
|
1365
1522
|
|
|
1366
|
-
var
|
|
1367
|
-
foo: {}
|
|
1368
|
-
};
|
|
1523
|
+
var $Object = require('es-object-atoms');
|
|
1369
1524
|
|
|
1370
|
-
|
|
1525
|
+
/** @type {import('./Object.getPrototypeOf')} */
|
|
1526
|
+
module.exports = $Object.getPrototypeOf || null;
|
|
1371
1527
|
|
|
1372
|
-
module
|
|
1373
|
-
|
|
1374
|
-
|
|
1528
|
+
},{"es-object-atoms":22}],27:[function(require,module,exports){
|
|
1529
|
+
'use strict';
|
|
1530
|
+
|
|
1531
|
+
/** @type {import('./Reflect.getPrototypeOf')} */
|
|
1532
|
+
module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
|
|
1533
|
+
|
|
1534
|
+
},{}],28:[function(require,module,exports){
|
|
1535
|
+
'use strict';
|
|
1536
|
+
|
|
1537
|
+
var reflectGetProto = require('./Reflect.getPrototypeOf');
|
|
1538
|
+
var originalGetProto = require('./Object.getPrototypeOf');
|
|
1539
|
+
|
|
1540
|
+
var getDunderProto = require('dunder-proto/get');
|
|
1375
1541
|
|
|
1376
|
-
|
|
1542
|
+
/** @type {import('.')} */
|
|
1543
|
+
module.exports = reflectGetProto
|
|
1544
|
+
? function getProto(O) {
|
|
1545
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
1546
|
+
return reflectGetProto(O);
|
|
1547
|
+
}
|
|
1548
|
+
: originalGetProto
|
|
1549
|
+
? function getProto(O) {
|
|
1550
|
+
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
1551
|
+
throw new TypeError('getProto: not an object');
|
|
1552
|
+
}
|
|
1553
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
1554
|
+
return originalGetProto(O);
|
|
1555
|
+
}
|
|
1556
|
+
: getDunderProto
|
|
1557
|
+
? function getProto(O) {
|
|
1558
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
1559
|
+
return getDunderProto(O);
|
|
1560
|
+
}
|
|
1561
|
+
: null;
|
|
1562
|
+
|
|
1563
|
+
},{"./Object.getPrototypeOf":26,"./Reflect.getPrototypeOf":27,"dunder-proto/get":13}],29:[function(require,module,exports){
|
|
1564
|
+
'use strict';
|
|
1565
|
+
|
|
1566
|
+
/** @type {import('./gOPD')} */
|
|
1567
|
+
module.exports = Object.getOwnPropertyDescriptor;
|
|
1568
|
+
|
|
1569
|
+
},{}],30:[function(require,module,exports){
|
|
1570
|
+
'use strict';
|
|
1571
|
+
|
|
1572
|
+
/** @type {import('.')} */
|
|
1573
|
+
var $gOPD = require('./gOPD');
|
|
1574
|
+
|
|
1575
|
+
if ($gOPD) {
|
|
1576
|
+
try {
|
|
1577
|
+
$gOPD([], 'length');
|
|
1578
|
+
} catch (e) {
|
|
1579
|
+
// IE 8 has a broken gOPD
|
|
1580
|
+
$gOPD = null;
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
module.exports = $gOPD;
|
|
1585
|
+
|
|
1586
|
+
},{"./gOPD":29}],31:[function(require,module,exports){
|
|
1377
1587
|
'use strict';
|
|
1378
1588
|
|
|
1379
1589
|
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
1380
1590
|
var hasSymbolSham = require('./shams');
|
|
1381
1591
|
|
|
1592
|
+
/** @type {import('.')} */
|
|
1382
1593
|
module.exports = function hasNativeSymbols() {
|
|
1383
1594
|
if (typeof origSymbol !== 'function') { return false; }
|
|
1384
1595
|
if (typeof Symbol !== 'function') { return false; }
|
|
@@ -1388,14 +1599,16 @@ module.exports = function hasNativeSymbols() {
|
|
|
1388
1599
|
return hasSymbolSham();
|
|
1389
1600
|
};
|
|
1390
1601
|
|
|
1391
|
-
},{"./shams":
|
|
1602
|
+
},{"./shams":32}],32:[function(require,module,exports){
|
|
1392
1603
|
'use strict';
|
|
1393
1604
|
|
|
1605
|
+
/** @type {import('./shams')} */
|
|
1394
1606
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
1395
1607
|
module.exports = function hasSymbols() {
|
|
1396
1608
|
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
|
1397
1609
|
if (typeof Symbol.iterator === 'symbol') { return true; }
|
|
1398
1610
|
|
|
1611
|
+
/** @type {{ [k in symbol]?: unknown }} */
|
|
1399
1612
|
var obj = {};
|
|
1400
1613
|
var sym = Symbol('test');
|
|
1401
1614
|
var symObj = Object(sym);
|
|
@@ -1414,7 +1627,7 @@ module.exports = function hasSymbols() {
|
|
|
1414
1627
|
|
|
1415
1628
|
var symVal = 42;
|
|
1416
1629
|
obj[sym] = symVal;
|
|
1417
|
-
for (
|
|
1630
|
+
for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
|
1418
1631
|
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
|
1419
1632
|
|
|
1420
1633
|
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
|
@@ -1425,21 +1638,83 @@ module.exports = function hasSymbols() {
|
|
|
1425
1638
|
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
|
1426
1639
|
|
|
1427
1640
|
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
|
1428
|
-
|
|
1641
|
+
// eslint-disable-next-line no-extra-parens
|
|
1642
|
+
var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
|
|
1429
1643
|
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
|
1430
1644
|
}
|
|
1431
1645
|
|
|
1432
1646
|
return true;
|
|
1433
1647
|
};
|
|
1434
1648
|
|
|
1435
|
-
},{}],
|
|
1649
|
+
},{}],33:[function(require,module,exports){
|
|
1436
1650
|
'use strict';
|
|
1437
1651
|
|
|
1652
|
+
var call = Function.prototype.call;
|
|
1653
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
1438
1654
|
var bind = require('function-bind');
|
|
1439
1655
|
|
|
1440
|
-
|
|
1656
|
+
/** @type {import('.')} */
|
|
1657
|
+
module.exports = bind.call(call, $hasOwn);
|
|
1658
|
+
|
|
1659
|
+
},{"function-bind":24}],34:[function(require,module,exports){
|
|
1660
|
+
'use strict';
|
|
1661
|
+
|
|
1662
|
+
/** @type {import('./abs')} */
|
|
1663
|
+
module.exports = Math.abs;
|
|
1664
|
+
|
|
1665
|
+
},{}],35:[function(require,module,exports){
|
|
1666
|
+
'use strict';
|
|
1667
|
+
|
|
1668
|
+
/** @type {import('./floor')} */
|
|
1669
|
+
module.exports = Math.floor;
|
|
1441
1670
|
|
|
1442
|
-
},{
|
|
1671
|
+
},{}],36:[function(require,module,exports){
|
|
1672
|
+
'use strict';
|
|
1673
|
+
|
|
1674
|
+
/** @type {import('./isNaN')} */
|
|
1675
|
+
module.exports = Number.isNaN || function isNaN(a) {
|
|
1676
|
+
return a !== a;
|
|
1677
|
+
};
|
|
1678
|
+
|
|
1679
|
+
},{}],37:[function(require,module,exports){
|
|
1680
|
+
'use strict';
|
|
1681
|
+
|
|
1682
|
+
/** @type {import('./max')} */
|
|
1683
|
+
module.exports = Math.max;
|
|
1684
|
+
|
|
1685
|
+
},{}],38:[function(require,module,exports){
|
|
1686
|
+
'use strict';
|
|
1687
|
+
|
|
1688
|
+
/** @type {import('./min')} */
|
|
1689
|
+
module.exports = Math.min;
|
|
1690
|
+
|
|
1691
|
+
},{}],39:[function(require,module,exports){
|
|
1692
|
+
'use strict';
|
|
1693
|
+
|
|
1694
|
+
/** @type {import('./pow')} */
|
|
1695
|
+
module.exports = Math.pow;
|
|
1696
|
+
|
|
1697
|
+
},{}],40:[function(require,module,exports){
|
|
1698
|
+
'use strict';
|
|
1699
|
+
|
|
1700
|
+
/** @type {import('./round')} */
|
|
1701
|
+
module.exports = Math.round;
|
|
1702
|
+
|
|
1703
|
+
},{}],41:[function(require,module,exports){
|
|
1704
|
+
'use strict';
|
|
1705
|
+
|
|
1706
|
+
var $isNaN = require('./isNaN');
|
|
1707
|
+
|
|
1708
|
+
/** @type {import('./sign')} */
|
|
1709
|
+
module.exports = function sign(number) {
|
|
1710
|
+
if ($isNaN(number) || number === 0) {
|
|
1711
|
+
return number;
|
|
1712
|
+
}
|
|
1713
|
+
return number < 0 ? -1 : +1;
|
|
1714
|
+
};
|
|
1715
|
+
|
|
1716
|
+
},{"./isNaN":36}],42:[function(require,module,exports){
|
|
1717
|
+
(function (global){(function (){
|
|
1443
1718
|
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
1444
1719
|
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
1445
1720
|
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
@@ -1511,10 +1786,21 @@ var utilInspect = require('./util.inspect');
|
|
|
1511
1786
|
var inspectCustom = utilInspect.custom;
|
|
1512
1787
|
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
1513
1788
|
|
|
1789
|
+
var quotes = {
|
|
1790
|
+
__proto__: null,
|
|
1791
|
+
'double': '"',
|
|
1792
|
+
single: "'"
|
|
1793
|
+
};
|
|
1794
|
+
var quoteREs = {
|
|
1795
|
+
__proto__: null,
|
|
1796
|
+
'double': /(["\\])/g,
|
|
1797
|
+
single: /(['\\])/g
|
|
1798
|
+
};
|
|
1799
|
+
|
|
1514
1800
|
module.exports = function inspect_(obj, options, depth, seen) {
|
|
1515
1801
|
var opts = options || {};
|
|
1516
1802
|
|
|
1517
|
-
if (has(opts, 'quoteStyle') && (
|
|
1803
|
+
if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
|
|
1518
1804
|
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
1519
1805
|
}
|
|
1520
1806
|
if (
|
|
@@ -1681,6 +1967,17 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
1681
1967
|
if (isString(obj)) {
|
|
1682
1968
|
return markBoxed(inspect(String(obj)));
|
|
1683
1969
|
}
|
|
1970
|
+
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
1971
|
+
/* eslint-env browser */
|
|
1972
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
1973
|
+
return '{ [object Window] }';
|
|
1974
|
+
}
|
|
1975
|
+
if (
|
|
1976
|
+
(typeof globalThis !== 'undefined' && obj === globalThis)
|
|
1977
|
+
|| (typeof global !== 'undefined' && obj === global)
|
|
1978
|
+
) {
|
|
1979
|
+
return '{ [object globalThis] }';
|
|
1980
|
+
}
|
|
1684
1981
|
if (!isDate(obj) && !isRegExp(obj)) {
|
|
1685
1982
|
var ys = arrObjKeys(obj, inspect);
|
|
1686
1983
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
@@ -1698,7 +1995,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
1698
1995
|
};
|
|
1699
1996
|
|
|
1700
1997
|
function wrapQuotes(s, defaultStyle, opts) {
|
|
1701
|
-
var
|
|
1998
|
+
var style = opts.quoteStyle || defaultStyle;
|
|
1999
|
+
var quoteChar = quotes[style];
|
|
1702
2000
|
return quoteChar + s + quoteChar;
|
|
1703
2001
|
}
|
|
1704
2002
|
|
|
@@ -1706,13 +2004,16 @@ function quote(s) {
|
|
|
1706
2004
|
return $replace.call(String(s), /"/g, '"');
|
|
1707
2005
|
}
|
|
1708
2006
|
|
|
1709
|
-
function
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
function
|
|
1713
|
-
function
|
|
1714
|
-
function
|
|
1715
|
-
function
|
|
2007
|
+
function canTrustToString(obj) {
|
|
2008
|
+
return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
|
|
2009
|
+
}
|
|
2010
|
+
function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }
|
|
2011
|
+
function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }
|
|
2012
|
+
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }
|
|
2013
|
+
function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }
|
|
2014
|
+
function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }
|
|
2015
|
+
function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }
|
|
2016
|
+
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }
|
|
1716
2017
|
|
|
1717
2018
|
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
1718
2019
|
function isSymbol(obj) {
|
|
@@ -1856,8 +2157,10 @@ function inspectString(str, opts) {
|
|
|
1856
2157
|
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
|
1857
2158
|
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
1858
2159
|
}
|
|
2160
|
+
var quoteRE = quoteREs[opts.quoteStyle || 'single'];
|
|
2161
|
+
quoteRE.lastIndex = 0;
|
|
1859
2162
|
// eslint-disable-next-line no-control-regex
|
|
1860
|
-
var s = $replace.call($replace.call(str,
|
|
2163
|
+
var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
|
1861
2164
|
return wrapQuotes(s, 'single', opts);
|
|
1862
2165
|
}
|
|
1863
2166
|
|
|
@@ -1957,131 +2260,322 @@ function arrObjKeys(obj, inspect) {
|
|
|
1957
2260
|
return xs;
|
|
1958
2261
|
}
|
|
1959
2262
|
|
|
1960
|
-
},
|
|
2263
|
+
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
2264
|
+
},{"./util.inspect":6}],43:[function(require,module,exports){
|
|
1961
2265
|
'use strict';
|
|
1962
2266
|
|
|
1963
|
-
var GetIntrinsic = require('get-intrinsic');
|
|
1964
|
-
var callBound = require('call-bind/callBound');
|
|
1965
2267
|
var inspect = require('object-inspect');
|
|
1966
2268
|
|
|
1967
|
-
var $TypeError =
|
|
1968
|
-
var $WeakMap = GetIntrinsic('%WeakMap%', true);
|
|
1969
|
-
var $Map = GetIntrinsic('%Map%', true);
|
|
1970
|
-
|
|
1971
|
-
var $weakMapGet = callBound('WeakMap.prototype.get', true);
|
|
1972
|
-
var $weakMapSet = callBound('WeakMap.prototype.set', true);
|
|
1973
|
-
var $weakMapHas = callBound('WeakMap.prototype.has', true);
|
|
1974
|
-
var $mapGet = callBound('Map.prototype.get', true);
|
|
1975
|
-
var $mapSet = callBound('Map.prototype.set', true);
|
|
1976
|
-
var $mapHas = callBound('Map.prototype.has', true);
|
|
2269
|
+
var $TypeError = require('es-errors/type');
|
|
1977
2270
|
|
|
1978
2271
|
/*
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
var listGetNode = function (list, key) {
|
|
1987
|
-
|
|
2272
|
+
* This function traverses the list returning the node corresponding to the given key.
|
|
2273
|
+
*
|
|
2274
|
+
* 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.
|
|
2275
|
+
* By doing so, all the recently used nodes can be accessed relatively quickly.
|
|
2276
|
+
*/
|
|
2277
|
+
/** @type {import('./list.d.ts').listGetNode} */
|
|
2278
|
+
// eslint-disable-next-line consistent-return
|
|
2279
|
+
var listGetNode = function (list, key, isDelete) {
|
|
2280
|
+
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
|
|
2281
|
+
var prev = list;
|
|
2282
|
+
/** @type {(typeof list)['next']} */
|
|
2283
|
+
var curr;
|
|
2284
|
+
// eslint-disable-next-line eqeqeq
|
|
2285
|
+
for (; (curr = prev.next) != null; prev = curr) {
|
|
1988
2286
|
if (curr.key === key) {
|
|
1989
2287
|
prev.next = curr.next;
|
|
1990
|
-
|
|
1991
|
-
|
|
2288
|
+
if (!isDelete) {
|
|
2289
|
+
// eslint-disable-next-line no-extra-parens
|
|
2290
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
|
|
2291
|
+
list.next = curr; // eslint-disable-line no-param-reassign
|
|
2292
|
+
}
|
|
1992
2293
|
return curr;
|
|
1993
2294
|
}
|
|
1994
2295
|
}
|
|
1995
2296
|
};
|
|
1996
2297
|
|
|
2298
|
+
/** @type {import('./list.d.ts').listGet} */
|
|
1997
2299
|
var listGet = function (objects, key) {
|
|
2300
|
+
if (!objects) {
|
|
2301
|
+
return void undefined;
|
|
2302
|
+
}
|
|
1998
2303
|
var node = listGetNode(objects, key);
|
|
1999
2304
|
return node && node.value;
|
|
2000
2305
|
};
|
|
2306
|
+
/** @type {import('./list.d.ts').listSet} */
|
|
2001
2307
|
var listSet = function (objects, key, value) {
|
|
2002
2308
|
var node = listGetNode(objects, key);
|
|
2003
2309
|
if (node) {
|
|
2004
2310
|
node.value = value;
|
|
2005
2311
|
} else {
|
|
2006
2312
|
// Prepend the new node to the beginning of the list
|
|
2007
|
-
objects.next = { // eslint-disable-line no-param-reassign
|
|
2313
|
+
objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
|
|
2008
2314
|
key: key,
|
|
2009
2315
|
next: objects.next,
|
|
2010
2316
|
value: value
|
|
2011
|
-
};
|
|
2317
|
+
});
|
|
2012
2318
|
}
|
|
2013
2319
|
};
|
|
2320
|
+
/** @type {import('./list.d.ts').listHas} */
|
|
2014
2321
|
var listHas = function (objects, key) {
|
|
2322
|
+
if (!objects) {
|
|
2323
|
+
return false;
|
|
2324
|
+
}
|
|
2015
2325
|
return !!listGetNode(objects, key);
|
|
2016
2326
|
};
|
|
2327
|
+
/** @type {import('./list.d.ts').listDelete} */
|
|
2328
|
+
// eslint-disable-next-line consistent-return
|
|
2329
|
+
var listDelete = function (objects, key) {
|
|
2330
|
+
if (objects) {
|
|
2331
|
+
return listGetNode(objects, key, true);
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2017
2334
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2335
|
+
/** @type {import('.')} */
|
|
2336
|
+
module.exports = function getSideChannelList() {
|
|
2337
|
+
/** @typedef {ReturnType<typeof getSideChannelList>} Channel */
|
|
2338
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
2339
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
2340
|
+
|
|
2341
|
+
/** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
|
|
2342
|
+
|
|
2343
|
+
/** @type {Channel} */
|
|
2022
2344
|
var channel = {
|
|
2023
2345
|
assert: function (key) {
|
|
2024
2346
|
if (!channel.has(key)) {
|
|
2025
2347
|
throw new $TypeError('Side channel does not contain ' + inspect(key));
|
|
2026
2348
|
}
|
|
2027
2349
|
},
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
} else if ($Map) {
|
|
2034
|
-
if ($m) {
|
|
2035
|
-
return $mapGet($m, key);
|
|
2036
|
-
}
|
|
2037
|
-
} else {
|
|
2038
|
-
if ($o) { // eslint-disable-line no-lonely-if
|
|
2039
|
-
return listGet($o, key);
|
|
2040
|
-
}
|
|
2350
|
+
'delete': function (key) {
|
|
2351
|
+
var root = $o && $o.next;
|
|
2352
|
+
var deletedNode = listDelete($o, key);
|
|
2353
|
+
if (deletedNode && root && root === deletedNode) {
|
|
2354
|
+
$o = void undefined;
|
|
2041
2355
|
}
|
|
2356
|
+
return !!deletedNode;
|
|
2357
|
+
},
|
|
2358
|
+
get: function (key) {
|
|
2359
|
+
return listGet($o, key);
|
|
2042
2360
|
},
|
|
2043
2361
|
has: function (key) {
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
|
|
2054
|
-
|
|
2362
|
+
return listHas($o, key);
|
|
2363
|
+
},
|
|
2364
|
+
set: function (key, value) {
|
|
2365
|
+
if (!$o) {
|
|
2366
|
+
// 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
|
|
2367
|
+
$o = {
|
|
2368
|
+
next: void undefined
|
|
2369
|
+
};
|
|
2370
|
+
}
|
|
2371
|
+
// eslint-disable-next-line no-extra-parens
|
|
2372
|
+
listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);
|
|
2373
|
+
}
|
|
2374
|
+
};
|
|
2375
|
+
// @ts-expect-error TODO: figure out why this is erroring
|
|
2376
|
+
return channel;
|
|
2377
|
+
};
|
|
2378
|
+
|
|
2379
|
+
},{"es-errors/type":20,"object-inspect":42}],44:[function(require,module,exports){
|
|
2380
|
+
'use strict';
|
|
2381
|
+
|
|
2382
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
2383
|
+
var callBound = require('call-bound');
|
|
2384
|
+
var inspect = require('object-inspect');
|
|
2385
|
+
|
|
2386
|
+
var $TypeError = require('es-errors/type');
|
|
2387
|
+
var $Map = GetIntrinsic('%Map%', true);
|
|
2388
|
+
|
|
2389
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
|
|
2390
|
+
var $mapGet = callBound('Map.prototype.get', true);
|
|
2391
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
|
|
2392
|
+
var $mapSet = callBound('Map.prototype.set', true);
|
|
2393
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
|
|
2394
|
+
var $mapHas = callBound('Map.prototype.has', true);
|
|
2395
|
+
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
|
|
2396
|
+
var $mapDelete = callBound('Map.prototype.delete', true);
|
|
2397
|
+
/** @type {<K, V>(thisArg: Map<K, V>) => number} */
|
|
2398
|
+
var $mapSize = callBound('Map.prototype.size', true);
|
|
2399
|
+
|
|
2400
|
+
/** @type {import('.')} */
|
|
2401
|
+
module.exports = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
|
|
2402
|
+
/** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
|
|
2403
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
2404
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
2405
|
+
|
|
2406
|
+
/** @type {Map<K, V> | undefined} */ var $m;
|
|
2407
|
+
|
|
2408
|
+
/** @type {Channel} */
|
|
2409
|
+
var channel = {
|
|
2410
|
+
assert: function (key) {
|
|
2411
|
+
if (!channel.has(key)) {
|
|
2412
|
+
throw new $TypeError('Side channel does not contain ' + inspect(key));
|
|
2413
|
+
}
|
|
2414
|
+
},
|
|
2415
|
+
'delete': function (key) {
|
|
2416
|
+
if ($m) {
|
|
2417
|
+
var result = $mapDelete($m, key);
|
|
2418
|
+
if ($mapSize($m) === 0) {
|
|
2419
|
+
$m = void undefined;
|
|
2055
2420
|
}
|
|
2421
|
+
return result;
|
|
2422
|
+
}
|
|
2423
|
+
return false;
|
|
2424
|
+
},
|
|
2425
|
+
get: function (key) { // eslint-disable-line consistent-return
|
|
2426
|
+
if ($m) {
|
|
2427
|
+
return $mapGet($m, key);
|
|
2428
|
+
}
|
|
2429
|
+
},
|
|
2430
|
+
has: function (key) {
|
|
2431
|
+
if ($m) {
|
|
2432
|
+
return $mapHas($m, key);
|
|
2056
2433
|
}
|
|
2057
2434
|
return false;
|
|
2058
2435
|
},
|
|
2059
2436
|
set: function (key, value) {
|
|
2060
|
-
if (
|
|
2061
|
-
|
|
2062
|
-
|
|
2437
|
+
if (!$m) {
|
|
2438
|
+
// @ts-expect-error TS can't handle narrowing a variable inside a closure
|
|
2439
|
+
$m = new $Map();
|
|
2440
|
+
}
|
|
2441
|
+
$mapSet($m, key, value);
|
|
2442
|
+
}
|
|
2443
|
+
};
|
|
2444
|
+
|
|
2445
|
+
// @ts-expect-error TODO: figure out why TS is erroring here
|
|
2446
|
+
return channel;
|
|
2447
|
+
};
|
|
2448
|
+
|
|
2449
|
+
},{"call-bound":12,"es-errors/type":20,"get-intrinsic":25,"object-inspect":42}],45:[function(require,module,exports){
|
|
2450
|
+
'use strict';
|
|
2451
|
+
|
|
2452
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
2453
|
+
var callBound = require('call-bound');
|
|
2454
|
+
var inspect = require('object-inspect');
|
|
2455
|
+
var getSideChannelMap = require('side-channel-map');
|
|
2456
|
+
|
|
2457
|
+
var $TypeError = require('es-errors/type');
|
|
2458
|
+
var $WeakMap = GetIntrinsic('%WeakMap%', true);
|
|
2459
|
+
|
|
2460
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
|
|
2461
|
+
var $weakMapGet = callBound('WeakMap.prototype.get', true);
|
|
2462
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
|
|
2463
|
+
var $weakMapSet = callBound('WeakMap.prototype.set', true);
|
|
2464
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
|
|
2465
|
+
var $weakMapHas = callBound('WeakMap.prototype.has', true);
|
|
2466
|
+
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
|
|
2467
|
+
var $weakMapDelete = callBound('WeakMap.prototype.delete', true);
|
|
2468
|
+
|
|
2469
|
+
/** @type {import('.')} */
|
|
2470
|
+
module.exports = $WeakMap
|
|
2471
|
+
? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {
|
|
2472
|
+
/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
|
|
2473
|
+
/** @typedef {Parameters<Channel['get']>[0]} K */
|
|
2474
|
+
/** @typedef {Parameters<Channel['set']>[1]} V */
|
|
2475
|
+
|
|
2476
|
+
/** @type {WeakMap<K & object, V> | undefined} */ var $wm;
|
|
2477
|
+
/** @type {Channel | undefined} */ var $m;
|
|
2478
|
+
|
|
2479
|
+
/** @type {Channel} */
|
|
2480
|
+
var channel = {
|
|
2481
|
+
assert: function (key) {
|
|
2482
|
+
if (!channel.has(key)) {
|
|
2483
|
+
throw new $TypeError('Side channel does not contain ' + inspect(key));
|
|
2063
2484
|
}
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
if (
|
|
2067
|
-
|
|
2485
|
+
},
|
|
2486
|
+
'delete': function (key) {
|
|
2487
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
2488
|
+
if ($wm) {
|
|
2489
|
+
return $weakMapDelete($wm, key);
|
|
2490
|
+
}
|
|
2491
|
+
} else if (getSideChannelMap) {
|
|
2492
|
+
if ($m) {
|
|
2493
|
+
return $m['delete'](key);
|
|
2494
|
+
}
|
|
2068
2495
|
}
|
|
2069
|
-
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2496
|
+
return false;
|
|
2497
|
+
},
|
|
2498
|
+
get: function (key) {
|
|
2499
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
2500
|
+
if ($wm) {
|
|
2501
|
+
return $weakMapGet($wm, key);
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
return $m && $m.get(key);
|
|
2505
|
+
},
|
|
2506
|
+
has: function (key) {
|
|
2507
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
2508
|
+
if ($wm) {
|
|
2509
|
+
return $weakMapHas($wm, key);
|
|
2510
|
+
}
|
|
2078
2511
|
}
|
|
2079
|
-
|
|
2512
|
+
return !!$m && $m.has(key);
|
|
2513
|
+
},
|
|
2514
|
+
set: function (key, value) {
|
|
2515
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
2516
|
+
if (!$wm) {
|
|
2517
|
+
$wm = new $WeakMap();
|
|
2518
|
+
}
|
|
2519
|
+
$weakMapSet($wm, key, value);
|
|
2520
|
+
} else if (getSideChannelMap) {
|
|
2521
|
+
if (!$m) {
|
|
2522
|
+
$m = getSideChannelMap();
|
|
2523
|
+
}
|
|
2524
|
+
// eslint-disable-next-line no-extra-parens
|
|
2525
|
+
/** @type {NonNullable<typeof $m>} */ ($m).set(key, value);
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
};
|
|
2529
|
+
|
|
2530
|
+
// @ts-expect-error TODO: figure out why this is erroring
|
|
2531
|
+
return channel;
|
|
2532
|
+
}
|
|
2533
|
+
: getSideChannelMap;
|
|
2534
|
+
|
|
2535
|
+
},{"call-bound":12,"es-errors/type":20,"get-intrinsic":25,"object-inspect":42,"side-channel-map":44}],46:[function(require,module,exports){
|
|
2536
|
+
'use strict';
|
|
2537
|
+
|
|
2538
|
+
var $TypeError = require('es-errors/type');
|
|
2539
|
+
var inspect = require('object-inspect');
|
|
2540
|
+
var getSideChannelList = require('side-channel-list');
|
|
2541
|
+
var getSideChannelMap = require('side-channel-map');
|
|
2542
|
+
var getSideChannelWeakMap = require('side-channel-weakmap');
|
|
2543
|
+
|
|
2544
|
+
var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
|
|
2545
|
+
|
|
2546
|
+
/** @type {import('.')} */
|
|
2547
|
+
module.exports = function getSideChannel() {
|
|
2548
|
+
/** @typedef {ReturnType<typeof getSideChannel>} Channel */
|
|
2549
|
+
|
|
2550
|
+
/** @type {Channel | undefined} */ var $channelData;
|
|
2551
|
+
|
|
2552
|
+
/** @type {Channel} */
|
|
2553
|
+
var channel = {
|
|
2554
|
+
assert: function (key) {
|
|
2555
|
+
if (!channel.has(key)) {
|
|
2556
|
+
throw new $TypeError('Side channel does not contain ' + inspect(key));
|
|
2080
2557
|
}
|
|
2558
|
+
},
|
|
2559
|
+
'delete': function (key) {
|
|
2560
|
+
return !!$channelData && $channelData['delete'](key);
|
|
2561
|
+
},
|
|
2562
|
+
get: function (key) {
|
|
2563
|
+
return $channelData && $channelData.get(key);
|
|
2564
|
+
},
|
|
2565
|
+
has: function (key) {
|
|
2566
|
+
return !!$channelData && $channelData.has(key);
|
|
2567
|
+
},
|
|
2568
|
+
set: function (key, value) {
|
|
2569
|
+
if (!$channelData) {
|
|
2570
|
+
$channelData = makeChannel();
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
$channelData.set(key, value);
|
|
2081
2574
|
}
|
|
2082
2575
|
};
|
|
2576
|
+
// @ts-expect-error TODO: figure out why this is erroring
|
|
2083
2577
|
return channel;
|
|
2084
2578
|
};
|
|
2085
2579
|
|
|
2086
|
-
},{"
|
|
2580
|
+
},{"es-errors/type":20,"object-inspect":42,"side-channel-list":43,"side-channel-map":44,"side-channel-weakmap":45}]},{},[2])(2)
|
|
2087
2581
|
});
|