123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493 |
- (function (f) {
- if (typeof exports === "object" && typeof module !== "undefined") {
- module.exports = f();
- } else if (typeof define === "function" && define.amd) {
- define([], f);
- } else {
- var g;
- if (typeof window !== "undefined") {
- g = window;
- } else if (typeof global !== "undefined") {
- g = global;
- } else if (typeof self !== "undefined") {
- g = self;
- } else {
- g = this;
- }
- g.Qs = f();
- }
- })(function () {
- var define, module, exports;
- return (function () {
- function r(e, n, t) {
- function o(i, f) {
- if (!n[i]) {
- if (!e[i]) {
- var c = "function" == typeof require && require;
- if (!f && c) return c(i, !0);
- if (u) return u(i, !0);
- var a = new Error("Cannot find module '" + i + "'");
- throw ((a.code = "MODULE_NOT_FOUND"), a);
- }
- var p = (n[i] = { exports: {} });
- e[i][0].call(
- p.exports,
- function (r) {
- var n = e[i][1][r];
- return o(n || r);
- },
- p,
- p.exports,
- r,
- e,
- n,
- t
- );
- }
- return n[i].exports;
- }
- for (
- var u = "function" == typeof require && require, i = 0;
- i < t.length;
- i++
- )
- o(t[i]);
- return o;
- }
- return r;
- })()(
- {
- 1: [
- function (require, module, exports) {
- "use strict";
- var replace = String.prototype.replace;
- var percentTwenties = /%20/g;
- var Format = {
- RFC1738: "RFC1738",
- RFC3986: "RFC3986",
- };
- module.exports = {
- default: Format.RFC3986,
- formatters: {
- RFC1738: function (value) {
- return replace.call(value, percentTwenties, "+");
- },
- RFC3986: function (value) {
- return String(value);
- },
- },
- RFC1738: Format.RFC1738,
- RFC3986: Format.RFC3986,
- };
- },
- {},
- ],
- 2: [
- function (require, module, exports) {
- "use strict";
- var stringify = require("./stringify");
- var parse = require("./parse");
- var formats = require("./formats");
- module.exports = {
- formats: formats,
- parse: parse,
- stringify: stringify,
- };
- },
- { "./formats": 1, "./parse": 3, "./stringify": 4 },
- ],
- 3: [
- function (require, module, exports) {
- "use strict";
- var utils = require("./utils");
- var has = Object.prototype.hasOwnProperty;
- var isArray = Array.isArray;
- var defaults = {
- allowDots: false,
- allowPrototypes: false,
- allowSparse: false,
- arrayLimit: 20,
- charset: "utf-8",
- charsetSentinel: false,
- comma: false,
- decoder: utils.decode,
- delimiter: "&",
- depth: 5,
- ignoreQueryPrefix: false,
- interpretNumericEntities: false,
- parameterLimit: 1000,
- parseArrays: true,
- plainObjects: false,
- strictNullHandling: false,
- };
- var interpretNumericEntities = function (str) {
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
- return String.fromCharCode(parseInt(numberStr, 10));
- });
- };
- var parseArrayValue = function (val, options) {
- if (
- val &&
- typeof val === "string" &&
- options.comma &&
- val.indexOf(",") > -1
- ) {
- return val.split(",");
- }
- return val;
- };
- // This is what browsers will submit when the ✓ character occurs in an
- // application/x-www-form-urlencoded body and the encoding of the page containing
- // the form is iso-8859-1, or when the submitted form has an accept-charset
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
- // the ✓ character, such as us-ascii.
- var isoSentinel = "utf8=%26%2310003%3B"; // encodeURIComponent('✓')
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
- var charsetSentinel = "utf8=%E2%9C%93"; // encodeURIComponent('✓')
- var parseValues = function parseQueryStringValues(str, options) {
- var obj = {};
- var cleanStr = options.ignoreQueryPrefix
- ? str.replace(/^\?/, "")
- : str;
- var limit =
- options.parameterLimit === Infinity
- ? undefined
- : options.parameterLimit;
- var parts = cleanStr.split(options.delimiter, limit);
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
- var i;
- var charset = options.charset;
- if (options.charsetSentinel) {
- for (i = 0; i < parts.length; ++i) {
- if (parts[i].indexOf("utf8=") === 0) {
- if (parts[i] === charsetSentinel) {
- charset = "utf-8";
- } else if (parts[i] === isoSentinel) {
- charset = "iso-8859-1";
- }
- skipIndex = i;
- i = parts.length; // The eslint settings do not allow break;
- }
- }
- }
- for (i = 0; i < parts.length; ++i) {
- if (i === skipIndex) {
- continue;
- }
- var part = parts[i];
- var bracketEqualsPos = part.indexOf("]=");
- var pos =
- bracketEqualsPos === -1
- ? part.indexOf("=")
- : bracketEqualsPos + 1;
- var key, val;
- if (pos === -1) {
- key = options.decoder(part, defaults.decoder, charset, "key");
- val = options.strictNullHandling ? null : "";
- } else {
- key = options.decoder(
- part.slice(0, pos),
- defaults.decoder,
- charset,
- "key"
- );
- val = utils.maybeMap(
- parseArrayValue(part.slice(pos + 1), options),
- function (encodedVal) {
- return options.decoder(
- encodedVal,
- defaults.decoder,
- charset,
- "value"
- );
- }
- );
- }
- if (
- val &&
- options.interpretNumericEntities &&
- charset === "iso-8859-1"
- ) {
- val = interpretNumericEntities(val);
- }
- if (part.indexOf("[]=") > -1) {
- val = isArray(val) ? [val] : val;
- }
- if (has.call(obj, key)) {
- obj[key] = utils.combine(obj[key], val);
- } else {
- obj[key] = val;
- }
- }
- return obj;
- };
- var parseObject = function (chain, val, options, valuesParsed) {
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
- for (var i = chain.length - 1; i >= 0; --i) {
- var obj;
- var root = chain[i];
- if (root === "[]" && options.parseArrays) {
- obj = [].concat(leaf);
- } else {
- obj = options.plainObjects ? Object.create(null) : {};
- var cleanRoot =
- root.charAt(0) === "[" && root.charAt(root.length - 1) === "]"
- ? root.slice(1, -1)
- : root;
- var index = parseInt(cleanRoot, 10);
- if (!options.parseArrays && cleanRoot === "") {
- obj = { 0: leaf };
- } else if (
- !isNaN(index) &&
- root !== cleanRoot &&
- String(index) === cleanRoot &&
- index >= 0 &&
- options.parseArrays &&
- index <= options.arrayLimit
- ) {
- obj = [];
- obj[index] = leaf;
- } else {
- obj[cleanRoot] = leaf;
- }
- }
- leaf = obj;
- }
- return leaf;
- };
- var parseKeys = function parseQueryStringKeys(
- givenKey,
- val,
- options,
- valuesParsed
- ) {
- if (!givenKey) {
- return;
- }
- // Transform dot notation to bracket notation
- var key = options.allowDots
- ? givenKey.replace(/\.([^.[]+)/g, "[$1]")
- : givenKey;
- // The regex chunks
- var brackets = /(\[[^[\]]*])/;
- var child = /(\[[^[\]]*])/g;
- // Get the parent
- var segment = options.depth > 0 && brackets.exec(key);
- var parent = segment ? key.slice(0, segment.index) : key;
- // Stash the parent if it exists
- var keys = [];
- if (parent) {
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
- if (!options.allowPrototypes) {
- return;
- }
- }
- keys.push(parent);
- }
- // Loop through children appending to the array until we hit depth
- var i = 0;
- while (
- options.depth > 0 &&
- (segment = child.exec(key)) !== null &&
- i < options.depth
- ) {
- i += 1;
- if (
- !options.plainObjects &&
- has.call(Object.prototype, segment[1].slice(1, -1))
- ) {
- if (!options.allowPrototypes) {
- return;
- }
- }
- keys.push(segment[1]);
- }
- // If there's a remainder, just add whatever is left
- if (segment) {
- keys.push("[" + key.slice(segment.index) + "]");
- }
- return parseObject(keys, val, options, valuesParsed);
- };
- var normalizeParseOptions = function normalizeParseOptions(opts) {
- if (!opts) {
- return defaults;
- }
- if (
- opts.decoder !== null &&
- opts.decoder !== undefined &&
- typeof opts.decoder !== "function"
- ) {
- throw new TypeError("Decoder has to be a function.");
- }
- if (
- typeof opts.charset !== "undefined" &&
- opts.charset !== "utf-8" &&
- opts.charset !== "iso-8859-1"
- ) {
- throw new TypeError(
- "The charset option must be either utf-8, iso-8859-1, or undefined"
- );
- }
- var charset =
- typeof opts.charset === "undefined"
- ? defaults.charset
- : opts.charset;
- return {
- allowDots:
- typeof opts.allowDots === "undefined"
- ? defaults.allowDots
- : !!opts.allowDots,
- allowPrototypes:
- typeof opts.allowPrototypes === "boolean"
- ? opts.allowPrototypes
- : defaults.allowPrototypes,
- allowSparse:
- typeof opts.allowSparse === "boolean"
- ? opts.allowSparse
- : defaults.allowSparse,
- arrayLimit:
- typeof opts.arrayLimit === "number"
- ? opts.arrayLimit
- : defaults.arrayLimit,
- charset: charset,
- charsetSentinel:
- typeof opts.charsetSentinel === "boolean"
- ? opts.charsetSentinel
- : defaults.charsetSentinel,
- comma:
- typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
- decoder:
- typeof opts.decoder === "function"
- ? opts.decoder
- : defaults.decoder,
- delimiter:
- typeof opts.delimiter === "string" ||
- utils.isRegExp(opts.delimiter)
- ? opts.delimiter
- : defaults.delimiter,
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
- depth:
- typeof opts.depth === "number" || opts.depth === false
- ? +opts.depth
- : defaults.depth,
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
- interpretNumericEntities:
- typeof opts.interpretNumericEntities === "boolean"
- ? opts.interpretNumericEntities
- : defaults.interpretNumericEntities,
- parameterLimit:
- typeof opts.parameterLimit === "number"
- ? opts.parameterLimit
- : defaults.parameterLimit,
- parseArrays: opts.parseArrays !== false,
- plainObjects:
- typeof opts.plainObjects === "boolean"
- ? opts.plainObjects
- : defaults.plainObjects,
- strictNullHandling:
- typeof opts.strictNullHandling === "boolean"
- ? opts.strictNullHandling
- : defaults.strictNullHandling,
- };
- };
- module.exports = function (str, opts) {
- var options = normalizeParseOptions(opts);
- if (str === "" || str === null || typeof str === "undefined") {
- return options.plainObjects ? Object.create(null) : {};
- }
- var tempObj =
- typeof str === "string" ? parseValues(str, options) : str;
- var obj = options.plainObjects ? Object.create(null) : {};
- // Iterate over the keys and setup the new object
- var keys = Object.keys(tempObj);
- for (var i = 0; i < keys.length; ++i) {
- var key = keys[i];
- var newObj = parseKeys(
- key,
- tempObj[key],
- options,
- typeof str === "string"
- );
- obj = utils.merge(obj, newObj, options);
- }
- if (options.allowSparse === true) {
- return obj;
- }
- return utils.compact(obj);
- };
- },
- { "./utils": 5 },
- ],
- 4: [
- function (require, module, exports) {
- "use strict";
- var getSideChannel = require("side-channel");
- var utils = require("./utils");
- var formats = require("./formats");
- var has = Object.prototype.hasOwnProperty;
- var arrayPrefixGenerators = {
- brackets: function brackets(prefix) {
- return prefix + "[]";
- },
- comma: "comma",
- indices: function indices(prefix, key) {
- return prefix + "[" + key + "]";
- },
- repeat: function repeat(prefix) {
- return prefix;
- },
- };
- var isArray = Array.isArray;
- var push = Array.prototype.push;
- var pushToArray = function (arr, valueOrArray) {
- push.apply(
- arr,
- isArray(valueOrArray) ? valueOrArray : [valueOrArray]
- );
- };
- var toISO = Date.prototype.toISOString;
- var defaultFormat = formats["default"];
- var defaults = {
- addQueryPrefix: false,
- allowDots: false,
- charset: "utf-8",
- charsetSentinel: false,
- delimiter: "&",
- encode: true,
- encoder: utils.encode,
- encodeValuesOnly: false,
- format: defaultFormat,
- formatter: formats.formatters[defaultFormat],
- // deprecated
- indices: false,
- serializeDate: function serializeDate(date) {
- return toISO.call(date);
- },
- skipNulls: false,
- strictNullHandling: false,
- };
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
- return (
- typeof v === "string" ||
- typeof v === "number" ||
- typeof v === "boolean" ||
- typeof v === "symbol" ||
- typeof v === "bigint"
- );
- };
- var stringify = function stringify(
- object,
- prefix,
- generateArrayPrefix,
- strictNullHandling,
- skipNulls,
- encoder,
- filter,
- sort,
- allowDots,
- serializeDate,
- format,
- formatter,
- encodeValuesOnly,
- charset,
- sideChannel
- ) {
- var obj = object;
- if (sideChannel.has(object)) {
- throw new RangeError("Cyclic object value");
- }
- if (typeof filter === "function") {
- obj = filter(prefix, obj);
- } else if (obj instanceof Date) {
- obj = serializeDate(obj);
- } else if (generateArrayPrefix === "comma" && isArray(obj)) {
- obj = utils.maybeMap(obj, function (value) {
- if (value instanceof Date) {
- return serializeDate(value);
- }
- return value;
- });
- }
- if (obj === null) {
- if (strictNullHandling) {
- return encoder && !encodeValuesOnly
- ? encoder(prefix, defaults.encoder, charset, "key", format)
- : prefix;
- }
- obj = "";
- }
- if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
- if (encoder) {
- var keyValue = encodeValuesOnly
- ? prefix
- : encoder(prefix, defaults.encoder, charset, "key", format);
- return [
- formatter(keyValue) +
- "=" +
- formatter(
- encoder(obj, defaults.encoder, charset, "value", format)
- ),
- ];
- }
- return [formatter(prefix) + "=" + formatter(String(obj))];
- }
- var values = [];
- if (typeof obj === "undefined") {
- return values;
- }
- var objKeys;
- if (generateArrayPrefix === "comma" && isArray(obj)) {
- // we need to join elements in
- objKeys = [
- { value: obj.length > 0 ? obj.join(",") || null : undefined },
- ];
- } else if (isArray(filter)) {
- objKeys = filter;
- } else {
- var keys = Object.keys(obj);
- objKeys = sort ? keys.sort(sort) : keys;
- }
- for (var i = 0; i < objKeys.length; ++i) {
- var key = objKeys[i];
- var value =
- typeof key === "object" && key.value !== undefined
- ? key.value
- : obj[key];
- if (skipNulls && value === null) {
- continue;
- }
- var keyPrefix = isArray(obj)
- ? typeof generateArrayPrefix === "function"
- ? generateArrayPrefix(prefix, key)
- : prefix
- : prefix + (allowDots ? "." + key : "[" + key + "]");
- sideChannel.set(object, true);
- pushToArray(
- values,
- stringify(
- value,
- keyPrefix,
- generateArrayPrefix,
- strictNullHandling,
- skipNulls,
- encoder,
- filter,
- sort,
- allowDots,
- serializeDate,
- format,
- formatter,
- encodeValuesOnly,
- charset,
- sideChannel
- )
- );
- }
- return values;
- };
- var normalizeStringifyOptions = function normalizeStringifyOptions(
- opts
- ) {
- if (!opts) {
- return defaults;
- }
- if (
- opts.encoder !== null &&
- opts.encoder !== undefined &&
- typeof opts.encoder !== "function"
- ) {
- throw new TypeError("Encoder has to be a function.");
- }
- var charset = opts.charset || defaults.charset;
- if (
- typeof opts.charset !== "undefined" &&
- opts.charset !== "utf-8" &&
- opts.charset !== "iso-8859-1"
- ) {
- throw new TypeError(
- "The charset option must be either utf-8, iso-8859-1, or undefined"
- );
- }
- var format = formats["default"];
- if (typeof opts.format !== "undefined") {
- if (!has.call(formats.formatters, opts.format)) {
- throw new TypeError("Unknown format option provided.");
- }
- format = opts.format;
- }
- var formatter = formats.formatters[format];
- var filter = defaults.filter;
- if (typeof opts.filter === "function" || isArray(opts.filter)) {
- filter = opts.filter;
- }
- return {
- addQueryPrefix:
- typeof opts.addQueryPrefix === "boolean"
- ? opts.addQueryPrefix
- : defaults.addQueryPrefix,
- allowDots:
- typeof opts.allowDots === "undefined"
- ? defaults.allowDots
- : !!opts.allowDots,
- charset: charset,
- charsetSentinel:
- typeof opts.charsetSentinel === "boolean"
- ? opts.charsetSentinel
- : defaults.charsetSentinel,
- delimiter:
- typeof opts.delimiter === "undefined"
- ? defaults.delimiter
- : opts.delimiter,
- encode:
- typeof opts.encode === "boolean"
- ? opts.encode
- : defaults.encode,
- encoder:
- typeof opts.encoder === "function"
- ? opts.encoder
- : defaults.encoder,
- encodeValuesOnly:
- typeof opts.encodeValuesOnly === "boolean"
- ? opts.encodeValuesOnly
- : defaults.encodeValuesOnly,
- filter: filter,
- format: format,
- formatter: formatter,
- serializeDate:
- typeof opts.serializeDate === "function"
- ? opts.serializeDate
- : defaults.serializeDate,
- skipNulls:
- typeof opts.skipNulls === "boolean"
- ? opts.skipNulls
- : defaults.skipNulls,
- sort: typeof opts.sort === "function" ? opts.sort : null,
- strictNullHandling:
- typeof opts.strictNullHandling === "boolean"
- ? opts.strictNullHandling
- : defaults.strictNullHandling,
- };
- };
- module.exports = function (object, opts) {
- var obj = object;
- var options = normalizeStringifyOptions(opts);
- var objKeys;
- var filter;
- if (typeof options.filter === "function") {
- filter = options.filter;
- obj = filter("", obj);
- } else if (isArray(options.filter)) {
- filter = options.filter;
- objKeys = filter;
- }
- var keys = [];
- if (typeof obj !== "object" || obj === null) {
- return "";
- }
- var arrayFormat;
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
- arrayFormat = opts.arrayFormat;
- } else if (opts && "indices" in opts) {
- arrayFormat = opts.indices ? "indices" : "repeat";
- } else {
- arrayFormat = "indices";
- }
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
- if (!objKeys) {
- objKeys = Object.keys(obj);
- }
- if (options.sort) {
- objKeys.sort(options.sort);
- }
- var sideChannel = getSideChannel();
- for (var i = 0; i < objKeys.length; ++i) {
- var key = objKeys[i];
- if (options.skipNulls && obj[key] === null) {
- continue;
- }
- pushToArray(
- keys,
- stringify(
- obj[key],
- key,
- generateArrayPrefix,
- options.strictNullHandling,
- options.skipNulls,
- options.encode ? options.encoder : null,
- options.filter,
- options.sort,
- options.allowDots,
- options.serializeDate,
- options.format,
- options.formatter,
- options.encodeValuesOnly,
- options.charset,
- sideChannel
- )
- );
- }
- var joined = keys.join(options.delimiter);
- var prefix = options.addQueryPrefix === true ? "?" : "";
- if (options.charsetSentinel) {
- if (options.charset === "iso-8859-1") {
- // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
- prefix += "utf8=%26%2310003%3B&";
- } else {
- // encodeURIComponent('✓')
- prefix += "utf8=%E2%9C%93&";
- }
- }
- return joined.length > 0 ? prefix + joined : "";
- };
- },
- { "./formats": 1, "./utils": 5, "side-channel": 16 },
- ],
- 5: [
- function (require, module, exports) {
- "use strict";
- var formats = require("./formats");
- var has = Object.prototype.hasOwnProperty;
- var isArray = Array.isArray;
- var hexTable = (function () {
- var array = [];
- for (var i = 0; i < 256; ++i) {
- array.push(
- "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase()
- );
- }
- return array;
- })();
- var compactQueue = function compactQueue(queue) {
- while (queue.length > 1) {
- var item = queue.pop();
- var obj = item.obj[item.prop];
- if (isArray(obj)) {
- var compacted = [];
- for (var j = 0; j < obj.length; ++j) {
- if (typeof obj[j] !== "undefined") {
- compacted.push(obj[j]);
- }
- }
- item.obj[item.prop] = compacted;
- }
- }
- };
- var arrayToObject = function arrayToObject(source, options) {
- var obj =
- options && options.plainObjects ? Object.create(null) : {};
- for (var i = 0; i < source.length; ++i) {
- if (typeof source[i] !== "undefined") {
- obj[i] = source[i];
- }
- }
- return obj;
- };
- var merge = function merge(target, source, options) {
- /* eslint no-param-reassign: 0 */
- if (!source) {
- return target;
- }
- if (typeof source !== "object") {
- if (isArray(target)) {
- target.push(source);
- } else if (target && typeof target === "object") {
- if (
- (options &&
- (options.plainObjects || options.allowPrototypes)) ||
- !has.call(Object.prototype, source)
- ) {
- target[source] = true;
- }
- } else {
- return [target, source];
- }
- return target;
- }
- if (!target || typeof target !== "object") {
- return [target].concat(source);
- }
- var mergeTarget = target;
- if (isArray(target) && !isArray(source)) {
- mergeTarget = arrayToObject(target, options);
- }
- if (isArray(target) && isArray(source)) {
- source.forEach(function (item, i) {
- if (has.call(target, i)) {
- var targetItem = target[i];
- if (
- targetItem &&
- typeof targetItem === "object" &&
- item &&
- typeof item === "object"
- ) {
- target[i] = merge(targetItem, item, options);
- } else {
- target.push(item);
- }
- } else {
- target[i] = item;
- }
- });
- return target;
- }
- return Object.keys(source).reduce(function (acc, key) {
- var value = source[key];
- if (has.call(acc, key)) {
- acc[key] = merge(acc[key], value, options);
- } else {
- acc[key] = value;
- }
- return acc;
- }, mergeTarget);
- };
- var assign = function assignSingleSource(target, source) {
- return Object.keys(source).reduce(function (acc, key) {
- acc[key] = source[key];
- return acc;
- }, target);
- };
- var decode = function (str, decoder, charset) {
- var strWithoutPlus = str.replace(/\+/g, " ");
- if (charset === "iso-8859-1") {
- // unescape never throws, no try...catch needed:
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
- }
- // utf-8
- try {
- return decodeURIComponent(strWithoutPlus);
- } catch (e) {
- return strWithoutPlus;
- }
- };
- var encode = function encode(
- str,
- defaultEncoder,
- charset,
- kind,
- format
- ) {
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
- // It has been adapted here for stricter adherence to RFC 3986
- if (str.length === 0) {
- return str;
- }
- var string = str;
- if (typeof str === "symbol") {
- string = Symbol.prototype.toString.call(str);
- } else if (typeof str !== "string") {
- string = String(str);
- }
- if (charset === "iso-8859-1") {
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
- return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
- });
- }
- var out = "";
- for (var i = 0; i < string.length; ++i) {
- var c = string.charCodeAt(i);
- if (
- c === 0x2d || // -
- c === 0x2e || // .
- c === 0x5f || // _
- c === 0x7e || // ~
- (c >= 0x30 && c <= 0x39) || // 0-9
- (c >= 0x41 && c <= 0x5a) || // a-z
- (c >= 0x61 && c <= 0x7a) || // A-Z
- (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
- ) {
- out += string.charAt(i);
- continue;
- }
- if (c < 0x80) {
- out = out + hexTable[c];
- continue;
- }
- if (c < 0x800) {
- out =
- out +
- (hexTable[0xc0 | (c >> 6)] + hexTable[0x80 | (c & 0x3f)]);
- continue;
- }
- if (c < 0xd800 || c >= 0xe000) {
- out =
- out +
- (hexTable[0xe0 | (c >> 12)] +
- hexTable[0x80 | ((c >> 6) & 0x3f)] +
- hexTable[0x80 | (c & 0x3f)]);
- continue;
- }
- i += 1;
- c =
- 0x10000 +
- (((c & 0x3ff) << 10) | (string.charCodeAt(i) & 0x3ff));
- out +=
- hexTable[0xf0 | (c >> 18)] +
- hexTable[0x80 | ((c >> 12) & 0x3f)] +
- hexTable[0x80 | ((c >> 6) & 0x3f)] +
- hexTable[0x80 | (c & 0x3f)];
- }
- return out;
- };
- var compact = function compact(value) {
- var queue = [{ obj: { o: value }, prop: "o" }];
- var refs = [];
- for (var i = 0; i < queue.length; ++i) {
- var item = queue[i];
- var obj = item.obj[item.prop];
- var keys = Object.keys(obj);
- for (var j = 0; j < keys.length; ++j) {
- var key = keys[j];
- var val = obj[key];
- if (
- typeof val === "object" &&
- val !== null &&
- refs.indexOf(val) === -1
- ) {
- queue.push({ obj: obj, prop: key });
- refs.push(val);
- }
- }
- }
- compactQueue(queue);
- return value;
- };
- var isRegExp = function isRegExp(obj) {
- return Object.prototype.toString.call(obj) === "[object RegExp]";
- };
- var isBuffer = function isBuffer(obj) {
- if (!obj || typeof obj !== "object") {
- return false;
- }
- return !!(
- obj.constructor &&
- obj.constructor.isBuffer &&
- obj.constructor.isBuffer(obj)
- );
- };
- var combine = function combine(a, b) {
- return [].concat(a, b);
- };
- var maybeMap = function maybeMap(val, fn) {
- if (isArray(val)) {
- var mapped = [];
- for (var i = 0; i < val.length; i += 1) {
- mapped.push(fn(val[i]));
- }
- return mapped;
- }
- return fn(val);
- };
- module.exports = {
- arrayToObject: arrayToObject,
- assign: assign,
- combine: combine,
- compact: compact,
- decode: decode,
- encode: encode,
- isBuffer: isBuffer,
- isRegExp: isRegExp,
- maybeMap: maybeMap,
- merge: merge,
- };
- },
- { "./formats": 1 },
- ],
- 6: [function (require, module, exports) {}, {}],
- 7: [
- function (require, module, exports) {
- "use strict";
- var GetIntrinsic = require("get-intrinsic");
- var callBind = require("./");
- var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
- module.exports = function callBoundIntrinsic(name, allowMissing) {
- var intrinsic = GetIntrinsic(name, !!allowMissing);
- if (
- typeof intrinsic === "function" &&
- $indexOf(name, ".prototype.") > -1
- ) {
- return callBind(intrinsic);
- }
- return intrinsic;
- };
- },
- { "./": 8, "get-intrinsic": 11 },
- ],
- 8: [
- function (require, module, exports) {
- "use strict";
- var bind = require("function-bind");
- var GetIntrinsic = require("get-intrinsic");
- var $apply = GetIntrinsic("%Function.prototype.apply%");
- var $call = GetIntrinsic("%Function.prototype.call%");
- var $reflectApply =
- GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
- var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true);
- var $defineProperty = GetIntrinsic("%Object.defineProperty%", true);
- var $max = GetIntrinsic("%Math.max%");
- if ($defineProperty) {
- try {
- $defineProperty({}, "a", { value: 1 });
- } catch (e) {
- // IE 8 has a broken defineProperty
- $defineProperty = null;
- }
- }
- module.exports = function callBind(originalFunction) {
- var func = $reflectApply(bind, $call, arguments);
- if ($gOPD && $defineProperty) {
- var desc = $gOPD(func, "length");
- if (desc.configurable) {
- // original length, plus the receiver, minus any additional arguments (after the receiver)
- $defineProperty(func, "length", {
- value:
- 1 +
- $max(0, originalFunction.length - (arguments.length - 1)),
- });
- }
- }
- return func;
- };
- var applyBind = function applyBind() {
- return $reflectApply(bind, $apply, arguments);
- };
- if ($defineProperty) {
- $defineProperty(module.exports, "apply", { value: applyBind });
- } else {
- module.exports.apply = applyBind;
- }
- },
- { "function-bind": 10, "get-intrinsic": 11 },
- ],
- 9: [
- function (require, module, exports) {
- "use strict";
- /* eslint no-invalid-this: 1 */
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
- var slice = Array.prototype.slice;
- var toStr = Object.prototype.toString;
- var funcType = "[object Function]";
- module.exports = function bind(that) {
- var target = this;
- if (
- typeof target !== "function" ||
- toStr.call(target) !== funcType
- ) {
- throw new TypeError(ERROR_MESSAGE + target);
- }
- var args = slice.call(arguments, 1);
- var bound;
- var binder = function () {
- if (this instanceof bound) {
- var result = target.apply(
- this,
- args.concat(slice.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
- } else {
- return target.apply(that, args.concat(slice.call(arguments)));
- }
- };
- var boundLength = Math.max(0, target.length - args.length);
- var boundArgs = [];
- for (var i = 0; i < boundLength; i++) {
- boundArgs.push("$" + i);
- }
- bound = Function(
- "binder",
- "return function (" +
- boundArgs.join(",") +
- "){ return binder.apply(this,arguments); }"
- )(binder);
- if (target.prototype) {
- var Empty = function Empty() {};
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- Empty.prototype = null;
- }
- return bound;
- };
- },
- {},
- ],
- 10: [
- function (require, module, exports) {
- "use strict";
- var implementation = require("./implementation");
- module.exports = Function.prototype.bind || implementation;
- },
- { "./implementation": 9 },
- ],
- 11: [
- function (require, module, exports) {
- "use strict";
- var undefined;
- var $SyntaxError = SyntaxError;
- var $Function = Function;
- var $TypeError = TypeError;
- // eslint-disable-next-line consistent-return
- var getEvalledConstructor = function (expressionSyntax) {
- try {
- return $Function(
- '"use strict"; return (' + expressionSyntax + ").constructor;"
- )();
- } catch (e) {}
- };
- var $gOPD = Object.getOwnPropertyDescriptor;
- if ($gOPD) {
- try {
- $gOPD({}, "");
- } catch (e) {
- $gOPD = null; // this is IE 8, which has a broken gOPD
- }
- }
- var throwTypeError = function () {
- throw new $TypeError();
- };
- var ThrowTypeError = $gOPD
- ? (function () {
- try {
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
- arguments.callee; // IE 8 does not throw here
- return throwTypeError;
- } catch (calleeThrows) {
- try {
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
- return $gOPD(arguments, "callee").get;
- } catch (gOPDthrows) {
- return throwTypeError;
- }
- }
- })()
- : throwTypeError;
- var hasSymbols = require("has-symbols")();
- var getProto =
- Object.getPrototypeOf ||
- function (x) {
- return x.__proto__;
- }; // eslint-disable-line no-proto
- var needsEval = {};
- var TypedArray =
- typeof Uint8Array === "undefined"
- ? undefined
- : getProto(Uint8Array);
- var INTRINSICS = {
- "%AggregateError%":
- typeof AggregateError === "undefined"
- ? undefined
- : AggregateError,
- "%Array%": Array,
- "%ArrayBuffer%":
- typeof ArrayBuffer === "undefined" ? undefined : ArrayBuffer,
- "%ArrayIteratorPrototype%": hasSymbols
- ? getProto([][Symbol.iterator]())
- : undefined,
- "%AsyncFromSyncIteratorPrototype%": undefined,
- "%AsyncFunction%": needsEval,
- "%AsyncGenerator%": needsEval,
- "%AsyncGeneratorFunction%": needsEval,
- "%AsyncIteratorPrototype%": needsEval,
- "%Atomics%": typeof Atomics === "undefined" ? undefined : Atomics,
- "%BigInt%": typeof BigInt === "undefined" ? undefined : BigInt,
- "%Boolean%": Boolean,
- "%DataView%":
- typeof DataView === "undefined" ? undefined : DataView,
- "%Date%": Date,
- "%decodeURI%": decodeURI,
- "%decodeURIComponent%": decodeURIComponent,
- "%encodeURI%": encodeURI,
- "%encodeURIComponent%": encodeURIComponent,
- "%Error%": Error,
- "%eval%": eval, // eslint-disable-line no-eval
- "%EvalError%": EvalError,
- "%Float32Array%":
- typeof Float32Array === "undefined" ? undefined : Float32Array,
- "%Float64Array%":
- typeof Float64Array === "undefined" ? undefined : Float64Array,
- "%FinalizationRegistry%":
- typeof FinalizationRegistry === "undefined"
- ? undefined
- : FinalizationRegistry,
- "%Function%": $Function,
- "%GeneratorFunction%": needsEval,
- "%Int8Array%":
- typeof Int8Array === "undefined" ? undefined : Int8Array,
- "%Int16Array%":
- typeof Int16Array === "undefined" ? undefined : Int16Array,
- "%Int32Array%":
- typeof Int32Array === "undefined" ? undefined : Int32Array,
- "%isFinite%": isFinite,
- "%isNaN%": isNaN,
- "%IteratorPrototype%": hasSymbols
- ? getProto(getProto([][Symbol.iterator]()))
- : undefined,
- "%JSON%": typeof JSON === "object" ? JSON : undefined,
- "%Map%": typeof Map === "undefined" ? undefined : Map,
- "%MapIteratorPrototype%":
- typeof Map === "undefined" || !hasSymbols
- ? undefined
- : getProto(new Map()[Symbol.iterator]()),
- "%Math%": Math,
- "%Number%": Number,
- "%Object%": Object,
- "%parseFloat%": parseFloat,
- "%parseInt%": parseInt,
- "%Promise%": typeof Promise === "undefined" ? undefined : Promise,
- "%Proxy%": typeof Proxy === "undefined" ? undefined : Proxy,
- "%RangeError%": RangeError,
- "%ReferenceError%": ReferenceError,
- "%Reflect%": typeof Reflect === "undefined" ? undefined : Reflect,
- "%RegExp%": RegExp,
- "%Set%": typeof Set === "undefined" ? undefined : Set,
- "%SetIteratorPrototype%":
- typeof Set === "undefined" || !hasSymbols
- ? undefined
- : getProto(new Set()[Symbol.iterator]()),
- "%SharedArrayBuffer%":
- typeof SharedArrayBuffer === "undefined"
- ? undefined
- : SharedArrayBuffer,
- "%String%": String,
- "%StringIteratorPrototype%": hasSymbols
- ? getProto(""[Symbol.iterator]())
- : undefined,
- "%Symbol%": hasSymbols ? Symbol : undefined,
- "%SyntaxError%": $SyntaxError,
- "%ThrowTypeError%": ThrowTypeError,
- "%TypedArray%": TypedArray,
- "%TypeError%": $TypeError,
- "%Uint8Array%":
- typeof Uint8Array === "undefined" ? undefined : Uint8Array,
- "%Uint8ClampedArray%":
- typeof Uint8ClampedArray === "undefined"
- ? undefined
- : Uint8ClampedArray,
- "%Uint16Array%":
- typeof Uint16Array === "undefined" ? undefined : Uint16Array,
- "%Uint32Array%":
- typeof Uint32Array === "undefined" ? undefined : Uint32Array,
- "%URIError%": URIError,
- "%WeakMap%": typeof WeakMap === "undefined" ? undefined : WeakMap,
- "%WeakRef%": typeof WeakRef === "undefined" ? undefined : WeakRef,
- "%WeakSet%": typeof WeakSet === "undefined" ? undefined : WeakSet,
- };
- var doEval = function doEval(name) {
- var value;
- if (name === "%AsyncFunction%") {
- value = getEvalledConstructor("async function () {}");
- } else if (name === "%GeneratorFunction%") {
- value = getEvalledConstructor("function* () {}");
- } else if (name === "%AsyncGeneratorFunction%") {
- value = getEvalledConstructor("async function* () {}");
- } else if (name === "%AsyncGenerator%") {
- var fn = doEval("%AsyncGeneratorFunction%");
- if (fn) {
- value = fn.prototype;
- }
- } else if (name === "%AsyncIteratorPrototype%") {
- var gen = doEval("%AsyncGenerator%");
- if (gen) {
- value = getProto(gen.prototype);
- }
- }
- INTRINSICS[name] = value;
- return value;
- };
- var LEGACY_ALIASES = {
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
- "%ArrayPrototype%": ["Array", "prototype"],
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
- "%ArrayProto_values%": ["Array", "prototype", "values"],
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
- "%AsyncGeneratorPrototype%": [
- "AsyncGeneratorFunction",
- "prototype",
- "prototype",
- ],
- "%BooleanPrototype%": ["Boolean", "prototype"],
- "%DataViewPrototype%": ["DataView", "prototype"],
- "%DatePrototype%": ["Date", "prototype"],
- "%ErrorPrototype%": ["Error", "prototype"],
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
- "%FunctionPrototype%": ["Function", "prototype"],
- "%Generator%": ["GeneratorFunction", "prototype"],
- "%GeneratorPrototype%": [
- "GeneratorFunction",
- "prototype",
- "prototype",
- ],
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
- "%JSONParse%": ["JSON", "parse"],
- "%JSONStringify%": ["JSON", "stringify"],
- "%MapPrototype%": ["Map", "prototype"],
- "%NumberPrototype%": ["Number", "prototype"],
- "%ObjectPrototype%": ["Object", "prototype"],
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
- "%PromisePrototype%": ["Promise", "prototype"],
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
- "%Promise_all%": ["Promise", "all"],
- "%Promise_reject%": ["Promise", "reject"],
- "%Promise_resolve%": ["Promise", "resolve"],
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
- "%RegExpPrototype%": ["RegExp", "prototype"],
- "%SetPrototype%": ["Set", "prototype"],
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
- "%StringPrototype%": ["String", "prototype"],
- "%SymbolPrototype%": ["Symbol", "prototype"],
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
- "%URIErrorPrototype%": ["URIError", "prototype"],
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
- "%WeakSetPrototype%": ["WeakSet", "prototype"],
- };
- var bind = require("function-bind");
- var hasOwn = require("has");
- var $concat = bind.call(Function.call, Array.prototype.concat);
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
- var $replace = bind.call(Function.call, String.prototype.replace);
- var $strSlice = bind.call(Function.call, String.prototype.slice);
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
- var rePropName =
- /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
- var reEscapeChar =
- /\\(\\)?/g; /** Used to match backslashes in property paths. */
- var stringToPath = function stringToPath(string) {
- var first = $strSlice(string, 0, 1);
- var last = $strSlice(string, -1);
- if (first === "%" && last !== "%") {
- throw new $SyntaxError(
- "invalid intrinsic syntax, expected closing `%`"
- );
- } else if (last === "%" && first !== "%") {
- throw new $SyntaxError(
- "invalid intrinsic syntax, expected opening `%`"
- );
- }
- var result = [];
- $replace(
- string,
- rePropName,
- function (match, number, quote, subString) {
- result[result.length] = quote
- ? $replace(subString, reEscapeChar, "$1")
- : number || match;
- }
- );
- return result;
- };
- /* end adaptation */
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
- var intrinsicName = name;
- var alias;
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
- alias = LEGACY_ALIASES[intrinsicName];
- intrinsicName = "%" + alias[0] + "%";
- }
- if (hasOwn(INTRINSICS, intrinsicName)) {
- var value = INTRINSICS[intrinsicName];
- if (value === needsEval) {
- value = doEval(intrinsicName);
- }
- if (typeof value === "undefined" && !allowMissing) {
- throw new $TypeError(
- "intrinsic " +
- name +
- " exists, but is not available. Please file an issue!"
- );
- }
- return {
- alias: alias,
- name: intrinsicName,
- value: value,
- };
- }
- throw new $SyntaxError("intrinsic " + name + " does not exist!");
- };
- module.exports = function GetIntrinsic(name, allowMissing) {
- if (typeof name !== "string" || name.length === 0) {
- throw new $TypeError("intrinsic name must be a non-empty string");
- }
- if (arguments.length > 1 && typeof allowMissing !== "boolean") {
- throw new $TypeError('"allowMissing" argument must be a boolean');
- }
- var parts = stringToPath(name);
- var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
- var intrinsic = getBaseIntrinsic(
- "%" + intrinsicBaseName + "%",
- allowMissing
- );
- var intrinsicRealName = intrinsic.name;
- var value = intrinsic.value;
- var skipFurtherCaching = false;
- var alias = intrinsic.alias;
- if (alias) {
- intrinsicBaseName = alias[0];
- $spliceApply(parts, $concat([0, 1], alias));
- }
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
- var part = parts[i];
- var first = $strSlice(part, 0, 1);
- var last = $strSlice(part, -1);
- if (
- (first === '"' ||
- first === "'" ||
- first === "`" ||
- last === '"' ||
- last === "'" ||
- last === "`") &&
- first !== last
- ) {
- throw new $SyntaxError(
- "property names with quotes must have matching quotes"
- );
- }
- if (part === "constructor" || !isOwn) {
- skipFurtherCaching = true;
- }
- intrinsicBaseName += "." + part;
- intrinsicRealName = "%" + intrinsicBaseName + "%";
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
- value = INTRINSICS[intrinsicRealName];
- } else if (value != null) {
- if (!(part in value)) {
- if (!allowMissing) {
- throw new $TypeError(
- "base intrinsic for " +
- name +
- " exists, but the property is not available."
- );
- }
- return void undefined;
- }
- if ($gOPD && i + 1 >= parts.length) {
- var desc = $gOPD(value, part);
- isOwn = !!desc;
- // By convention, when a data property is converted to an accessor
- // property to emulate a data property that does not suffer from
- // the override mistake, that accessor's getter is marked with
- // an `originalValue` property. Here, when we detect this, we
- // uphold the illusion by pretending to see that original data
- // property, i.e., returning the value rather than the getter
- // itself.
- if (
- isOwn &&
- "get" in desc &&
- !("originalValue" in desc.get)
- ) {
- value = desc.get;
- } else {
- value = value[part];
- }
- } else {
- isOwn = hasOwn(value, part);
- value = value[part];
- }
- if (isOwn && !skipFurtherCaching) {
- INTRINSICS[intrinsicRealName] = value;
- }
- }
- }
- return value;
- };
- },
- { "function-bind": 10, has: 14, "has-symbols": 12 },
- ],
- 12: [
- function (require, module, exports) {
- "use strict";
- var origSymbol = typeof Symbol !== "undefined" && Symbol;
- var hasSymbolSham = require("./shams");
- module.exports = function hasNativeSymbols() {
- if (typeof origSymbol !== "function") {
- return false;
- }
- if (typeof Symbol !== "function") {
- return false;
- }
- if (typeof origSymbol("foo") !== "symbol") {
- return false;
- }
- if (typeof Symbol("bar") !== "symbol") {
- return false;
- }
- return hasSymbolSham();
- };
- },
- { "./shams": 13 },
- ],
- 13: [
- function (require, module, exports) {
- "use strict";
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
- module.exports = function hasSymbols() {
- if (
- typeof Symbol !== "function" ||
- typeof Object.getOwnPropertySymbols !== "function"
- ) {
- return false;
- }
- if (typeof Symbol.iterator === "symbol") {
- return true;
- }
- var obj = {};
- var sym = Symbol("test");
- var symObj = Object(sym);
- if (typeof sym === "string") {
- return false;
- }
- if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
- return false;
- }
- if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
- return false;
- }
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
- // if (sym instanceof Symbol) { return false; }
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
- // if (!(symObj instanceof Symbol)) { return false; }
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
- var symVal = 42;
- obj[sym] = symVal;
- for (sym in obj) {
- return false;
- } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
- if (
- typeof Object.keys === "function" &&
- Object.keys(obj).length !== 0
- ) {
- return false;
- }
- if (
- typeof Object.getOwnPropertyNames === "function" &&
- Object.getOwnPropertyNames(obj).length !== 0
- ) {
- return false;
- }
- var syms = Object.getOwnPropertySymbols(obj);
- if (syms.length !== 1 || syms[0] !== sym) {
- return false;
- }
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
- return false;
- }
- if (typeof Object.getOwnPropertyDescriptor === "function") {
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
- if (
- descriptor.value !== symVal ||
- descriptor.enumerable !== true
- ) {
- return false;
- }
- }
- return true;
- };
- },
- {},
- ],
- 14: [
- function (require, module, exports) {
- "use strict";
- var bind = require("function-bind");
- module.exports = bind.call(
- Function.call,
- Object.prototype.hasOwnProperty
- );
- },
- { "function-bind": 10 },
- ],
- 15: [
- function (require, module, exports) {
- var hasMap = typeof Map === "function" && Map.prototype;
- var mapSizeDescriptor =
- Object.getOwnPropertyDescriptor && hasMap
- ? Object.getOwnPropertyDescriptor(Map.prototype, "size")
- : null;
- var mapSize =
- hasMap &&
- mapSizeDescriptor &&
- typeof mapSizeDescriptor.get === "function"
- ? mapSizeDescriptor.get
- : null;
- var mapForEach = hasMap && Map.prototype.forEach;
- var hasSet = typeof Set === "function" && Set.prototype;
- var setSizeDescriptor =
- Object.getOwnPropertyDescriptor && hasSet
- ? Object.getOwnPropertyDescriptor(Set.prototype, "size")
- : null;
- var setSize =
- hasSet &&
- setSizeDescriptor &&
- typeof setSizeDescriptor.get === "function"
- ? setSizeDescriptor.get
- : null;
- var setForEach = hasSet && Set.prototype.forEach;
- var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
- var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
- var booleanValueOf = Boolean.prototype.valueOf;
- var objectToString = Object.prototype.toString;
- var functionToString = Function.prototype.toString;
- var match = String.prototype.match;
- var bigIntValueOf =
- typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
- var gOPS = Object.getOwnPropertySymbols;
- var symToString =
- typeof Symbol === "function" ? Symbol.prototype.toString : null;
- var isEnumerable = Object.prototype.propertyIsEnumerable;
- var inspectCustom = require("./util.inspect").custom;
- var inspectSymbol =
- inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
- module.exports = function inspect_(obj, options, depth, seen) {
- var opts = options || {};
- if (
- has(opts, "quoteStyle") &&
- opts.quoteStyle !== "single" &&
- opts.quoteStyle !== "double"
- ) {
- throw new TypeError(
- 'option "quoteStyle" must be "single" or "double"'
- );
- }
- if (
- has(opts, "maxStringLength") &&
- (typeof opts.maxStringLength === "number"
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
- : opts.maxStringLength !== null)
- ) {
- throw new TypeError(
- 'option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'
- );
- }
- var customInspect = has(opts, "customInspect")
- ? opts.customInspect
- : true;
- if (typeof customInspect !== "boolean") {
- throw new TypeError(
- 'option "customInspect", if provided, must be `true` or `false`'
- );
- }
- if (
- has(opts, "indent") &&
- opts.indent !== null &&
- opts.indent !== "\t" &&
- !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
- ) {
- throw new TypeError(
- 'options "indent" must be "\\t", an integer > 0, or `null`'
- );
- }
- if (typeof obj === "undefined") {
- return "undefined";
- }
- if (obj === null) {
- return "null";
- }
- if (typeof obj === "boolean") {
- return obj ? "true" : "false";
- }
- if (typeof obj === "string") {
- return inspectString(obj, opts);
- }
- if (typeof obj === "number") {
- if (obj === 0) {
- return Infinity / obj > 0 ? "0" : "-0";
- }
- return String(obj);
- }
- if (typeof obj === "bigint") {
- return String(obj) + "n";
- }
- var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
- if (typeof depth === "undefined") {
- depth = 0;
- }
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") {
- return isArray(obj) ? "[Array]" : "[Object]";
- }
- var indent = getIndent(opts, depth);
- if (typeof seen === "undefined") {
- seen = [];
- } else if (indexOf(seen, obj) >= 0) {
- return "[Circular]";
- }
- function inspect(value, from, noIndent) {
- if (from) {
- seen = seen.slice();
- seen.push(from);
- }
- if (noIndent) {
- var newOpts = {
- depth: opts.depth,
- };
- if (has(opts, "quoteStyle")) {
- newOpts.quoteStyle = opts.quoteStyle;
- }
- return inspect_(value, newOpts, depth + 1, seen);
- }
- return inspect_(value, opts, depth + 1, seen);
- }
- if (typeof obj === "function") {
- var name = nameOf(obj);
- var keys = arrObjKeys(obj, inspect);
- return (
- "[Function" +
- (name ? ": " + name : " (anonymous)") +
- "]" +
- (keys.length > 0 ? " { " + keys.join(", ") + " }" : "")
- );
- }
- if (isSymbol(obj)) {
- var symString = symToString.call(obj);
- return typeof obj === "object" ? markBoxed(symString) : symString;
- }
- if (isElement(obj)) {
- var s = "<" + String(obj.nodeName).toLowerCase();
- var attrs = obj.attributes || [];
- for (var i = 0; i < attrs.length; i++) {
- s +=
- " " +
- attrs[i].name +
- "=" +
- wrapQuotes(quote(attrs[i].value), "double", opts);
- }
- s += ">";
- if (obj.childNodes && obj.childNodes.length) {
- s += "...";
- }
- s += "</" + String(obj.nodeName).toLowerCase() + ">";
- return s;
- }
- if (isArray(obj)) {
- if (obj.length === 0) {
- return "[]";
- }
- var xs = arrObjKeys(obj, inspect);
- if (indent && !singleLineValues(xs)) {
- return "[" + indentedJoin(xs, indent) + "]";
- }
- return "[ " + xs.join(", ") + " ]";
- }
- if (isError(obj)) {
- var parts = arrObjKeys(obj, inspect);
- if (parts.length === 0) {
- return "[" + String(obj) + "]";
- }
- return "{ [" + String(obj) + "] " + parts.join(", ") + " }";
- }
- if (typeof obj === "object" && customInspect) {
- if (inspectSymbol && typeof obj[inspectSymbol] === "function") {
- return obj[inspectSymbol]();
- } else if (typeof obj.inspect === "function") {
- return obj.inspect();
- }
- }
- if (isMap(obj)) {
- var mapParts = [];
- mapForEach.call(obj, function (value, key) {
- mapParts.push(
- inspect(key, obj, true) + " => " + inspect(value, obj)
- );
- });
- return collectionOf("Map", mapSize.call(obj), mapParts, indent);
- }
- if (isSet(obj)) {
- var setParts = [];
- setForEach.call(obj, function (value) {
- setParts.push(inspect(value, obj));
- });
- return collectionOf("Set", setSize.call(obj), setParts, indent);
- }
- if (isWeakMap(obj)) {
- return weakCollectionOf("WeakMap");
- }
- if (isWeakSet(obj)) {
- return weakCollectionOf("WeakSet");
- }
- if (isNumber(obj)) {
- return markBoxed(inspect(Number(obj)));
- }
- if (isBigInt(obj)) {
- return markBoxed(inspect(bigIntValueOf.call(obj)));
- }
- if (isBoolean(obj)) {
- return markBoxed(booleanValueOf.call(obj));
- }
- if (isString(obj)) {
- return markBoxed(inspect(String(obj)));
- }
- if (!isDate(obj) && !isRegExp(obj)) {
- var ys = arrObjKeys(obj, inspect);
- if (ys.length === 0) {
- return "{}";
- }
- if (indent) {
- return "{" + indentedJoin(ys, indent) + "}";
- }
- return "{ " + ys.join(", ") + " }";
- }
- return String(obj);
- };
- function wrapQuotes(s, defaultStyle, opts) {
- var quoteChar =
- (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'";
- return quoteChar + s + quoteChar;
- }
- function quote(s) {
- return String(s).replace(/"/g, """);
- }
- function isArray(obj) {
- return toStr(obj) === "[object Array]";
- }
- function isDate(obj) {
- return toStr(obj) === "[object Date]";
- }
- function isRegExp(obj) {
- return toStr(obj) === "[object RegExp]";
- }
- function isError(obj) {
- return toStr(obj) === "[object Error]";
- }
- function isSymbol(obj) {
- return toStr(obj) === "[object Symbol]";
- }
- function isString(obj) {
- return toStr(obj) === "[object String]";
- }
- function isNumber(obj) {
- return toStr(obj) === "[object Number]";
- }
- function isBigInt(obj) {
- return toStr(obj) === "[object BigInt]";
- }
- function isBoolean(obj) {
- return toStr(obj) === "[object Boolean]";
- }
- var hasOwn =
- Object.prototype.hasOwnProperty ||
- function (key) {
- return key in this;
- };
- function has(obj, key) {
- return hasOwn.call(obj, key);
- }
- function toStr(obj) {
- return objectToString.call(obj);
- }
- function nameOf(f) {
- if (f.name) {
- return f.name;
- }
- var m = match.call(
- functionToString.call(f),
- /^function\s*([\w$]+)/
- );
- if (m) {
- return m[1];
- }
- return null;
- }
- function indexOf(xs, x) {
- if (xs.indexOf) {
- return xs.indexOf(x);
- }
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) {
- return i;
- }
- }
- return -1;
- }
- function isMap(x) {
- if (!mapSize || !x || typeof x !== "object") {
- return false;
- }
- try {
- mapSize.call(x);
- try {
- setSize.call(x);
- } catch (s) {
- return true;
- }
- return x instanceof Map; // core-js workaround, pre-v2.5.0
- } catch (e) {}
- return false;
- }
- function isWeakMap(x) {
- if (!weakMapHas || !x || typeof x !== "object") {
- return false;
- }
- try {
- weakMapHas.call(x, weakMapHas);
- try {
- weakSetHas.call(x, weakSetHas);
- } catch (s) {
- return true;
- }
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
- } catch (e) {}
- return false;
- }
- function isSet(x) {
- if (!setSize || !x || typeof x !== "object") {
- return false;
- }
- try {
- setSize.call(x);
- try {
- mapSize.call(x);
- } catch (m) {
- return true;
- }
- return x instanceof Set; // core-js workaround, pre-v2.5.0
- } catch (e) {}
- return false;
- }
- function isWeakSet(x) {
- if (!weakSetHas || !x || typeof x !== "object") {
- return false;
- }
- try {
- weakSetHas.call(x, weakSetHas);
- try {
- weakMapHas.call(x, weakMapHas);
- } catch (s) {
- return true;
- }
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
- } catch (e) {}
- return false;
- }
- function isElement(x) {
- if (!x || typeof x !== "object") {
- return false;
- }
- if (
- typeof HTMLElement !== "undefined" &&
- x instanceof HTMLElement
- ) {
- return true;
- }
- return (
- typeof x.nodeName === "string" &&
- typeof x.getAttribute === "function"
- );
- }
- function inspectString(str, opts) {
- if (str.length > opts.maxStringLength) {
- var remaining = str.length - opts.maxStringLength;
- var trailer =
- "... " +
- remaining +
- " more character" +
- (remaining > 1 ? "s" : "");
- return (
- inspectString(str.slice(0, opts.maxStringLength), opts) +
- trailer
- );
- }
- // eslint-disable-next-line no-control-regex
- var s = str
- .replace(/(['\\])/g, "\\$1")
- .replace(/[\x00-\x1f]/g, lowbyte);
- return wrapQuotes(s, "single", opts);
- }
- function lowbyte(c) {
- var n = c.charCodeAt(0);
- var x = {
- 8: "b",
- 9: "t",
- 10: "n",
- 12: "f",
- 13: "r",
- }[n];
- if (x) {
- return "\\" + x;
- }
- return "\\x" + (n < 0x10 ? "0" : "") + n.toString(16).toUpperCase();
- }
- function markBoxed(str) {
- return "Object(" + str + ")";
- }
- function weakCollectionOf(type) {
- return type + " { ? }";
- }
- function collectionOf(type, size, entries, indent) {
- var joinedEntries = indent
- ? indentedJoin(entries, indent)
- : entries.join(", ");
- return type + " (" + size + ") {" + joinedEntries + "}";
- }
- function singleLineValues(xs) {
- for (var i = 0; i < xs.length; i++) {
- if (indexOf(xs[i], "\n") >= 0) {
- return false;
- }
- }
- return true;
- }
- function getIndent(opts, depth) {
- var baseIndent;
- if (opts.indent === "\t") {
- baseIndent = "\t";
- } else if (typeof opts.indent === "number" && opts.indent > 0) {
- baseIndent = Array(opts.indent + 1).join(" ");
- } else {
- return null;
- }
- return {
- base: baseIndent,
- prev: Array(depth + 1).join(baseIndent),
- };
- }
- function indentedJoin(xs, indent) {
- if (xs.length === 0) {
- return "";
- }
- var lineJoiner = "\n" + indent.prev + indent.base;
- return lineJoiner + xs.join("," + lineJoiner) + "\n" + indent.prev;
- }
- function arrObjKeys(obj, inspect) {
- var isArr = isArray(obj);
- var xs = [];
- if (isArr) {
- xs.length = obj.length;
- for (var i = 0; i < obj.length; i++) {
- xs[i] = has(obj, i) ? inspect(obj[i], obj) : "";
- }
- }
- for (var key in obj) {
- // eslint-disable-line no-restricted-syntax
- if (!has(obj, key)) {
- continue;
- } // eslint-disable-line no-restricted-syntax, no-continue
- if (isArr && String(Number(key)) === key && key < obj.length) {
- continue;
- } // eslint-disable-line no-restricted-syntax, no-continue
- if (/[^\w$]/.test(key)) {
- xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
- } else {
- xs.push(key + ": " + inspect(obj[key], obj));
- }
- }
- if (typeof gOPS === "function") {
- var syms = gOPS(obj);
- for (var j = 0; j < syms.length; j++) {
- if (isEnumerable.call(obj, syms[j])) {
- xs.push(
- "[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj)
- );
- }
- }
- }
- return xs;
- }
- },
- { "./util.inspect": 6 },
- ],
- 16: [
- function (require, module, exports) {
- "use strict";
- var GetIntrinsic = require("get-intrinsic");
- var callBound = require("call-bind/callBound");
- var inspect = require("object-inspect");
- var $TypeError = GetIntrinsic("%TypeError%");
- var $WeakMap = GetIntrinsic("%WeakMap%", true);
- var $Map = GetIntrinsic("%Map%", true);
- var $weakMapGet = callBound("WeakMap.prototype.get", true);
- var $weakMapSet = callBound("WeakMap.prototype.set", true);
- var $weakMapHas = callBound("WeakMap.prototype.has", true);
- var $mapGet = callBound("Map.prototype.get", true);
- var $mapSet = callBound("Map.prototype.set", true);
- var $mapHas = callBound("Map.prototype.has", true);
- /*
- * This function traverses the list returning the node corresponding to the
- * given key.
- *
- * 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.
- */
- var listGetNode = function (list, key) {
- // eslint-disable-line consistent-return
- for (
- var prev = list, curr;
- (curr = prev.next) !== null;
- prev = curr
- ) {
- if (curr.key === key) {
- prev.next = curr.next;
- curr.next = list.next;
- list.next = curr; // eslint-disable-line no-param-reassign
- return curr;
- }
- }
- };
- var listGet = function (objects, key) {
- var node = listGetNode(objects, key);
- return node && node.value;
- };
- var listSet = function (objects, key, value) {
- var node = listGetNode(objects, key);
- if (node) {
- node.value = value;
- } else {
- // Prepend the new node to the beginning of the list
- objects.next = {
- // eslint-disable-line no-param-reassign
- key: key,
- next: objects.next,
- value: value,
- };
- }
- };
- var listHas = function (objects, key) {
- return !!listGetNode(objects, key);
- };
- module.exports = function getSideChannel() {
- var $wm;
- var $m;
- var $o;
- var channel = {
- assert: function (key) {
- if (!channel.has(key)) {
- throw new $TypeError(
- "Side channel does not contain " + inspect(key)
- );
- }
- },
- get: function (key) {
- // eslint-disable-line consistent-return
- if (
- $WeakMap &&
- key &&
- (typeof key === "object" || typeof key === "function")
- ) {
- if ($wm) {
- return $weakMapGet($wm, key);
- }
- } else if ($Map) {
- if ($m) {
- return $mapGet($m, key);
- }
- } else {
- if ($o) {
- // eslint-disable-line no-lonely-if
- return listGet($o, key);
- }
- }
- },
- has: function (key) {
- if (
- $WeakMap &&
- key &&
- (typeof key === "object" || typeof key === "function")
- ) {
- if ($wm) {
- return $weakMapHas($wm, key);
- }
- } else if ($Map) {
- if ($m) {
- return $mapHas($m, key);
- }
- } else {
- if ($o) {
- // eslint-disable-line no-lonely-if
- return listHas($o, key);
- }
- }
- return false;
- },
- set: function (key, value) {
- if (
- $WeakMap &&
- key &&
- (typeof key === "object" || typeof key === "function")
- ) {
- if (!$wm) {
- $wm = new $WeakMap();
- }
- $weakMapSet($wm, key, value);
- } else if ($Map) {
- if (!$m) {
- $m = new $Map();
- }
- $mapSet($m, key, value);
- } else {
- if (!$o) {
- /*
- * 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
- */
- $o = { key: {}, next: null };
- }
- listSet($o, key, value);
- }
- },
- };
- return channel;
- };
- },
- { "call-bind/callBound": 7, "get-intrinsic": 11, "object-inspect": 15 },
- ],
- },
- {},
- [2]
- )(2);
- });
|