contentful 11.10.2 → 11.10.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/dist/contentful.browser.js +336 -287
- package/dist/contentful.browser.min.js +1 -1
- package/dist/contentful.cjs +243 -204
- package/dist/stats-browser-min.html +1 -1
- package/package.json +4 -3
package/dist/contentful.cjs
CHANGED
|
@@ -12958,7 +12958,7 @@ FormData$2.prototype.submit = function (params, cb) {
|
|
|
12958
12958
|
var callback = function (error, responce) {
|
|
12959
12959
|
request.removeListener('error', callback);
|
|
12960
12960
|
request.removeListener('response', onResponse);
|
|
12961
|
-
return cb.call(this, error, responce);
|
|
12961
|
+
return cb.call(this, error, responce);
|
|
12962
12962
|
};
|
|
12963
12963
|
onResponse = callback.bind(this, null);
|
|
12964
12964
|
request.on('error', callback);
|
|
@@ -12977,7 +12977,7 @@ FormData$2.prototype._error = function (err) {
|
|
|
12977
12977
|
FormData$2.prototype.toString = function () {
|
|
12978
12978
|
return '[object FormData]';
|
|
12979
12979
|
};
|
|
12980
|
-
setToStringTag(FormData$2, 'FormData');
|
|
12980
|
+
setToStringTag(FormData$2.prototype, 'FormData');
|
|
12981
12981
|
|
|
12982
12982
|
// Public API
|
|
12983
12983
|
var form_data = FormData$2;
|
|
@@ -14752,7 +14752,7 @@ const kindOfTest = type => {
|
|
|
14752
14752
|
const typeOfTest = type => thing => typeof thing === type;
|
|
14753
14753
|
|
|
14754
14754
|
/**
|
|
14755
|
-
* Determine if a value is
|
|
14755
|
+
* Determine if a value is a non-null object
|
|
14756
14756
|
*
|
|
14757
14757
|
* @param {Object} val The value to test
|
|
14758
14758
|
*
|
|
@@ -14769,7 +14769,7 @@ const {
|
|
|
14769
14769
|
*
|
|
14770
14770
|
* @returns {boolean} True if the value is undefined, otherwise false
|
|
14771
14771
|
*/
|
|
14772
|
-
const isUndefined = typeOfTest(
|
|
14772
|
+
const isUndefined = typeOfTest("undefined");
|
|
14773
14773
|
|
|
14774
14774
|
/**
|
|
14775
14775
|
* Determine if a value is a Buffer
|
|
@@ -14789,7 +14789,7 @@ function isBuffer$1(val) {
|
|
|
14789
14789
|
*
|
|
14790
14790
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
14791
14791
|
*/
|
|
14792
|
-
const isArrayBuffer = kindOfTest(
|
|
14792
|
+
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
14793
14793
|
|
|
14794
14794
|
/**
|
|
14795
14795
|
* Determine if a value is a view on an ArrayBuffer
|
|
@@ -14800,7 +14800,7 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
|
14800
14800
|
*/
|
|
14801
14801
|
function isArrayBufferView(val) {
|
|
14802
14802
|
let result;
|
|
14803
|
-
if (typeof ArrayBuffer !==
|
|
14803
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
14804
14804
|
result = ArrayBuffer.isView(val);
|
|
14805
14805
|
} else {
|
|
14806
14806
|
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
@@ -14815,7 +14815,7 @@ function isArrayBufferView(val) {
|
|
|
14815
14815
|
*
|
|
14816
14816
|
* @returns {boolean} True if value is a String, otherwise false
|
|
14817
14817
|
*/
|
|
14818
|
-
const isString$3 = typeOfTest(
|
|
14818
|
+
const isString$3 = typeOfTest("string");
|
|
14819
14819
|
|
|
14820
14820
|
/**
|
|
14821
14821
|
* Determine if a value is a Function
|
|
@@ -14823,7 +14823,7 @@ const isString$3 = typeOfTest('string');
|
|
|
14823
14823
|
* @param {*} val The value to test
|
|
14824
14824
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
14825
14825
|
*/
|
|
14826
|
-
const isFunction$1 = typeOfTest(
|
|
14826
|
+
const isFunction$1 = typeOfTest("function");
|
|
14827
14827
|
|
|
14828
14828
|
/**
|
|
14829
14829
|
* Determine if a value is a Number
|
|
@@ -14832,7 +14832,7 @@ const isFunction$1 = typeOfTest('function');
|
|
|
14832
14832
|
*
|
|
14833
14833
|
* @returns {boolean} True if value is a Number, otherwise false
|
|
14834
14834
|
*/
|
|
14835
|
-
const isNumber$1 = typeOfTest(
|
|
14835
|
+
const isNumber$1 = typeOfTest("number");
|
|
14836
14836
|
|
|
14837
14837
|
/**
|
|
14838
14838
|
* Determine if a value is an Object
|
|
@@ -14841,7 +14841,7 @@ const isNumber$1 = typeOfTest('number');
|
|
|
14841
14841
|
*
|
|
14842
14842
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
14843
14843
|
*/
|
|
14844
|
-
const isObject = thing => thing !== null && typeof thing ===
|
|
14844
|
+
const isObject = thing => thing !== null && typeof thing === "object";
|
|
14845
14845
|
|
|
14846
14846
|
/**
|
|
14847
14847
|
* Determine if a value is a Boolean
|
|
@@ -14859,7 +14859,7 @@ const isBoolean$1 = thing => thing === true || thing === false;
|
|
|
14859
14859
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
14860
14860
|
*/
|
|
14861
14861
|
const isPlainObject$2 = val => {
|
|
14862
|
-
if (kindOf(val) !==
|
|
14862
|
+
if (kindOf(val) !== "object") {
|
|
14863
14863
|
return false;
|
|
14864
14864
|
}
|
|
14865
14865
|
const prototype = getPrototypeOf$1(val);
|
|
@@ -14893,7 +14893,7 @@ const isEmptyObject = val => {
|
|
|
14893
14893
|
*
|
|
14894
14894
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
14895
14895
|
*/
|
|
14896
|
-
const isDate$1 = kindOfTest(
|
|
14896
|
+
const isDate$1 = kindOfTest("Date");
|
|
14897
14897
|
|
|
14898
14898
|
/**
|
|
14899
14899
|
* Determine if a value is a File
|
|
@@ -14902,7 +14902,7 @@ const isDate$1 = kindOfTest('Date');
|
|
|
14902
14902
|
*
|
|
14903
14903
|
* @returns {boolean} True if value is a File, otherwise false
|
|
14904
14904
|
*/
|
|
14905
|
-
const isFile = kindOfTest(
|
|
14905
|
+
const isFile = kindOfTest("File");
|
|
14906
14906
|
|
|
14907
14907
|
/**
|
|
14908
14908
|
* Determine if a value is a Blob
|
|
@@ -14911,7 +14911,7 @@ const isFile = kindOfTest('File');
|
|
|
14911
14911
|
*
|
|
14912
14912
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
14913
14913
|
*/
|
|
14914
|
-
const isBlob = kindOfTest(
|
|
14914
|
+
const isBlob = kindOfTest("Blob");
|
|
14915
14915
|
|
|
14916
14916
|
/**
|
|
14917
14917
|
* Determine if a value is a FileList
|
|
@@ -14920,7 +14920,7 @@ const isBlob = kindOfTest('Blob');
|
|
|
14920
14920
|
*
|
|
14921
14921
|
* @returns {boolean} True if value is a File, otherwise false
|
|
14922
14922
|
*/
|
|
14923
|
-
const isFileList = kindOfTest(
|
|
14923
|
+
const isFileList = kindOfTest("FileList");
|
|
14924
14924
|
|
|
14925
14925
|
/**
|
|
14926
14926
|
* Determine if a value is a Stream
|
|
@@ -14940,9 +14940,9 @@ const isStream = val => isObject(val) && isFunction$1(val.pipe);
|
|
|
14940
14940
|
*/
|
|
14941
14941
|
const isFormData = thing => {
|
|
14942
14942
|
let kind;
|
|
14943
|
-
return thing && (typeof FormData ===
|
|
14943
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" ||
|
|
14944
14944
|
// detect form-data instance
|
|
14945
|
-
kind ===
|
|
14945
|
+
kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
|
|
14946
14946
|
};
|
|
14947
14947
|
|
|
14948
14948
|
/**
|
|
@@ -14952,8 +14952,8 @@ const isFormData = thing => {
|
|
|
14952
14952
|
*
|
|
14953
14953
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
14954
14954
|
*/
|
|
14955
|
-
const isURLSearchParams = kindOfTest(
|
|
14956
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
14955
|
+
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
14956
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
14957
14957
|
|
|
14958
14958
|
/**
|
|
14959
14959
|
* Trim excess whitespace off the beginning and end of a string
|
|
@@ -14962,7 +14962,7 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
|
|
|
14962
14962
|
*
|
|
14963
14963
|
* @returns {String} The String freed of excess whitespace
|
|
14964
14964
|
*/
|
|
14965
|
-
const trim = str => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
|
14965
|
+
const trim = str => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
14966
14966
|
|
|
14967
14967
|
/**
|
|
14968
14968
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
@@ -14973,24 +14973,25 @@ const trim = str => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uF
|
|
|
14973
14973
|
* If 'obj' is an Object callback will be called passing
|
|
14974
14974
|
* the value, key, and complete object for each property.
|
|
14975
14975
|
*
|
|
14976
|
-
* @param {Object|Array} obj The object to iterate
|
|
14976
|
+
* @param {Object|Array<unknown>} obj The object to iterate
|
|
14977
14977
|
* @param {Function} fn The callback to invoke for each item
|
|
14978
14978
|
*
|
|
14979
|
-
* @param {
|
|
14979
|
+
* @param {Object} [options]
|
|
14980
|
+
* @param {Boolean} [options.allOwnKeys = false]
|
|
14980
14981
|
* @returns {any}
|
|
14981
14982
|
*/
|
|
14982
14983
|
function forEach(obj, fn, {
|
|
14983
14984
|
allOwnKeys = false
|
|
14984
14985
|
} = {}) {
|
|
14985
14986
|
// Don't bother if no value provided
|
|
14986
|
-
if (obj === null || typeof obj ===
|
|
14987
|
+
if (obj === null || typeof obj === "undefined") {
|
|
14987
14988
|
return;
|
|
14988
14989
|
}
|
|
14989
14990
|
let i;
|
|
14990
14991
|
let l;
|
|
14991
14992
|
|
|
14992
14993
|
// Force an array if not already something iterable
|
|
14993
|
-
if (typeof obj !==
|
|
14994
|
+
if (typeof obj !== "object") {
|
|
14994
14995
|
/*eslint no-param-reassign:0*/
|
|
14995
14996
|
obj = [obj];
|
|
14996
14997
|
}
|
|
@@ -15034,7 +15035,7 @@ function findKey(obj, key) {
|
|
|
15034
15035
|
const _global = (() => {
|
|
15035
15036
|
/*eslint no-undef:0*/
|
|
15036
15037
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
15037
|
-
return typeof self !== "undefined" ? self : typeof window !==
|
|
15038
|
+
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
15038
15039
|
})();
|
|
15039
15040
|
const isContextDefined = context => !isUndefined(context) && context !== _global;
|
|
15040
15041
|
|
|
@@ -15048,7 +15049,7 @@ const isContextDefined = context => !isUndefined(context) && context !== _global
|
|
|
15048
15049
|
* Example:
|
|
15049
15050
|
*
|
|
15050
15051
|
* ```js
|
|
15051
|
-
*
|
|
15052
|
+
* const result = merge({foo: 123}, {foo: 456});
|
|
15052
15053
|
* console.log(result.foo); // outputs 456
|
|
15053
15054
|
* ```
|
|
15054
15055
|
*
|
|
@@ -15064,6 +15065,10 @@ function merge$1(/* obj1, obj2, obj3, ... */
|
|
|
15064
15065
|
} = isContextDefined(this) && this || {};
|
|
15065
15066
|
const result = {};
|
|
15066
15067
|
const assignValue = (val, key) => {
|
|
15068
|
+
// Skip dangerous property names to prevent prototype pollution
|
|
15069
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
15070
|
+
return;
|
|
15071
|
+
}
|
|
15067
15072
|
const targetKey = caseless && findKey(result, key) || key;
|
|
15068
15073
|
if (isPlainObject$2(result[targetKey]) && isPlainObject$2(val)) {
|
|
15069
15074
|
result[targetKey] = merge$1(result[targetKey], val);
|
|
@@ -15088,7 +15093,8 @@ function merge$1(/* obj1, obj2, obj3, ... */
|
|
|
15088
15093
|
* @param {Object} b The object to copy properties from
|
|
15089
15094
|
* @param {Object} thisArg The object to bind function to
|
|
15090
15095
|
*
|
|
15091
|
-
* @param {
|
|
15096
|
+
* @param {Object} [options]
|
|
15097
|
+
* @param {Boolean} [options.allOwnKeys]
|
|
15092
15098
|
* @returns {Object} The resulting value of object a
|
|
15093
15099
|
*/
|
|
15094
15100
|
const extend = (a, b, thisArg, {
|
|
@@ -15096,9 +15102,19 @@ const extend = (a, b, thisArg, {
|
|
|
15096
15102
|
} = {}) => {
|
|
15097
15103
|
forEach(b, (val, key) => {
|
|
15098
15104
|
if (thisArg && isFunction$1(val)) {
|
|
15099
|
-
a
|
|
15105
|
+
Object.defineProperty(a, key, {
|
|
15106
|
+
value: bind(val, thisArg),
|
|
15107
|
+
writable: true,
|
|
15108
|
+
enumerable: true,
|
|
15109
|
+
configurable: true
|
|
15110
|
+
});
|
|
15100
15111
|
} else {
|
|
15101
|
-
a
|
|
15112
|
+
Object.defineProperty(a, key, {
|
|
15113
|
+
value: val,
|
|
15114
|
+
writable: true,
|
|
15115
|
+
enumerable: true,
|
|
15116
|
+
configurable: true
|
|
15117
|
+
});
|
|
15102
15118
|
}
|
|
15103
15119
|
}, {
|
|
15104
15120
|
allOwnKeys
|
|
@@ -15114,7 +15130,7 @@ const extend = (a, b, thisArg, {
|
|
|
15114
15130
|
* @returns {string} content value without BOM
|
|
15115
15131
|
*/
|
|
15116
15132
|
const stripBOM = content => {
|
|
15117
|
-
if (content.charCodeAt(0) ===
|
|
15133
|
+
if (content.charCodeAt(0) === 0xfeff) {
|
|
15118
15134
|
content = content.slice(1);
|
|
15119
15135
|
}
|
|
15120
15136
|
return content;
|
|
@@ -15131,8 +15147,13 @@ const stripBOM = content => {
|
|
|
15131
15147
|
*/
|
|
15132
15148
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
15133
15149
|
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
15134
|
-
constructor.prototype
|
|
15135
|
-
|
|
15150
|
+
Object.defineProperty(constructor.prototype, "constructor", {
|
|
15151
|
+
value: constructor,
|
|
15152
|
+
writable: true,
|
|
15153
|
+
enumerable: false,
|
|
15154
|
+
configurable: true
|
|
15155
|
+
});
|
|
15156
|
+
Object.defineProperty(constructor, "super", {
|
|
15136
15157
|
value: superConstructor.prototype
|
|
15137
15158
|
});
|
|
15138
15159
|
props && Object.assign(constructor.prototype, props);
|
|
@@ -15222,7 +15243,7 @@ const isTypedArray = (TypedArray => {
|
|
|
15222
15243
|
return thing => {
|
|
15223
15244
|
return TypedArray && thing instanceof TypedArray;
|
|
15224
15245
|
};
|
|
15225
|
-
})(typeof Uint8Array !==
|
|
15246
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf$1(Uint8Array));
|
|
15226
15247
|
|
|
15227
15248
|
/**
|
|
15228
15249
|
* For each entry in the object, call the function with the key and value.
|
|
@@ -15260,7 +15281,7 @@ const matchAll = (regExp, str) => {
|
|
|
15260
15281
|
};
|
|
15261
15282
|
|
|
15262
15283
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
15263
|
-
const isHTMLForm = kindOfTest(
|
|
15284
|
+
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
15264
15285
|
const toCamelCase = str => {
|
|
15265
15286
|
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
15266
15287
|
return p1.toUpperCase() + p2;
|
|
@@ -15279,7 +15300,7 @@ const hasOwnProperty$3 = (({
|
|
|
15279
15300
|
*
|
|
15280
15301
|
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
15281
15302
|
*/
|
|
15282
|
-
const isRegExp$2 = kindOfTest(
|
|
15303
|
+
const isRegExp$2 = kindOfTest("RegExp");
|
|
15283
15304
|
const reduceDescriptors = (obj, reducer) => {
|
|
15284
15305
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
15285
15306
|
const reducedDescriptors = {};
|
|
@@ -15300,19 +15321,19 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
15300
15321
|
const freezeMethods = obj => {
|
|
15301
15322
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
15302
15323
|
// skip restricted props in strict mode
|
|
15303
|
-
if (isFunction$1(obj) && [
|
|
15324
|
+
if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
15304
15325
|
return false;
|
|
15305
15326
|
}
|
|
15306
15327
|
const value = obj[name];
|
|
15307
15328
|
if (!isFunction$1(value)) return;
|
|
15308
15329
|
descriptor.enumerable = false;
|
|
15309
|
-
if (
|
|
15330
|
+
if ("writable" in descriptor) {
|
|
15310
15331
|
descriptor.writable = false;
|
|
15311
15332
|
return;
|
|
15312
15333
|
}
|
|
15313
15334
|
if (!descriptor.set) {
|
|
15314
15335
|
descriptor.set = () => {
|
|
15315
|
-
throw Error(
|
|
15336
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
15316
15337
|
};
|
|
15317
15338
|
}
|
|
15318
15339
|
});
|
|
@@ -15340,7 +15361,7 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
15340
15361
|
* @returns {boolean}
|
|
15341
15362
|
*/
|
|
15342
15363
|
function isSpecCompliantForm(thing) {
|
|
15343
|
-
return !!(thing && isFunction$1(thing.append) && thing[toStringTag$1] ===
|
|
15364
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag$1] === "FormData" && thing[iterator]);
|
|
15344
15365
|
}
|
|
15345
15366
|
const toJSONObject = obj => {
|
|
15346
15367
|
const stack = new Array(10);
|
|
@@ -15354,7 +15375,7 @@ const toJSONObject = obj => {
|
|
|
15354
15375
|
if (isBuffer$1(source)) {
|
|
15355
15376
|
return source;
|
|
15356
15377
|
}
|
|
15357
|
-
if (!(
|
|
15378
|
+
if (!("toJSON" in source)) {
|
|
15358
15379
|
stack[i] = source;
|
|
15359
15380
|
const target = isArray$7(source) ? [] : {};
|
|
15360
15381
|
forEach(source, (value, key) => {
|
|
@@ -15369,7 +15390,7 @@ const toJSONObject = obj => {
|
|
|
15369
15390
|
};
|
|
15370
15391
|
return visit(obj, 0);
|
|
15371
15392
|
};
|
|
15372
|
-
const isAsyncFn = kindOfTest(
|
|
15393
|
+
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
15373
15394
|
const isThenable = thing => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
15374
15395
|
|
|
15375
15396
|
// original code
|
|
@@ -15393,8 +15414,8 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
15393
15414
|
_global.postMessage(token, "*");
|
|
15394
15415
|
};
|
|
15395
15416
|
})(`axios@${Math.random()}`, []) : cb => setTimeout(cb);
|
|
15396
|
-
})(typeof setImmediate ===
|
|
15397
|
-
const asap = typeof queueMicrotask !==
|
|
15417
|
+
})(typeof setImmediate === "function", isFunction$1(_global.postMessage));
|
|
15418
|
+
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
15398
15419
|
|
|
15399
15420
|
// *********************
|
|
15400
15421
|
|
|
@@ -15459,37 +15480,39 @@ const utils$1$1 = {
|
|
|
15459
15480
|
asap,
|
|
15460
15481
|
isIterable
|
|
15461
15482
|
};
|
|
15462
|
-
|
|
15463
|
-
|
|
15464
|
-
|
|
15465
|
-
|
|
15466
|
-
|
|
15467
|
-
|
|
15468
|
-
|
|
15469
|
-
* @param {Object} [request] The request.
|
|
15470
|
-
* @param {Object} [response] The response.
|
|
15471
|
-
*
|
|
15472
|
-
* @returns {Error} The created error.
|
|
15473
|
-
*/
|
|
15474
|
-
function AxiosError(message, code, config, request, response) {
|
|
15475
|
-
Error.call(this);
|
|
15476
|
-
if (Error.captureStackTrace) {
|
|
15477
|
-
Error.captureStackTrace(this, this.constructor);
|
|
15478
|
-
} else {
|
|
15479
|
-
this.stack = new Error().stack;
|
|
15480
|
-
}
|
|
15481
|
-
this.message = message;
|
|
15482
|
-
this.name = 'AxiosError';
|
|
15483
|
-
code && (this.code = code);
|
|
15484
|
-
config && (this.config = config);
|
|
15485
|
-
request && (this.request = request);
|
|
15486
|
-
if (response) {
|
|
15487
|
-
this.response = response;
|
|
15488
|
-
this.status = response.status ? response.status : null;
|
|
15483
|
+
class AxiosError extends Error {
|
|
15484
|
+
static from(error, code, config, request, response, customProps) {
|
|
15485
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
15486
|
+
axiosError.cause = error;
|
|
15487
|
+
axiosError.name = error.name;
|
|
15488
|
+
customProps && Object.assign(axiosError, customProps);
|
|
15489
|
+
return axiosError;
|
|
15489
15490
|
}
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15491
|
+
|
|
15492
|
+
/**
|
|
15493
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
15494
|
+
*
|
|
15495
|
+
* @param {string} message The error message.
|
|
15496
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
15497
|
+
* @param {Object} [config] The config.
|
|
15498
|
+
* @param {Object} [request] The request.
|
|
15499
|
+
* @param {Object} [response] The response.
|
|
15500
|
+
*
|
|
15501
|
+
* @returns {Error} The created error.
|
|
15502
|
+
*/
|
|
15503
|
+
constructor(message, code, config, request, response) {
|
|
15504
|
+
super(message);
|
|
15505
|
+
this.name = 'AxiosError';
|
|
15506
|
+
this.isAxiosError = true;
|
|
15507
|
+
code && (this.code = code);
|
|
15508
|
+
config && (this.config = config);
|
|
15509
|
+
request && (this.request = request);
|
|
15510
|
+
if (response) {
|
|
15511
|
+
this.response = response;
|
|
15512
|
+
this.status = response.status;
|
|
15513
|
+
}
|
|
15514
|
+
}
|
|
15515
|
+
toJSON() {
|
|
15493
15516
|
return {
|
|
15494
15517
|
// Standard
|
|
15495
15518
|
message: this.message,
|
|
@@ -15508,46 +15531,22 @@ utils$1$1.inherits(AxiosError, Error, {
|
|
|
15508
15531
|
status: this.status
|
|
15509
15532
|
};
|
|
15510
15533
|
}
|
|
15511
|
-
}
|
|
15512
|
-
const prototype$1 = AxiosError.prototype;
|
|
15513
|
-
const descriptors = {};
|
|
15514
|
-
['ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED', 'ERR_NOT_SUPPORT', 'ERR_INVALID_URL'
|
|
15515
|
-
// eslint-disable-next-line func-names
|
|
15516
|
-
].forEach(code => {
|
|
15517
|
-
descriptors[code] = {
|
|
15518
|
-
value: code
|
|
15519
|
-
};
|
|
15520
|
-
});
|
|
15521
|
-
Object.defineProperties(AxiosError, descriptors);
|
|
15522
|
-
Object.defineProperty(prototype$1, 'isAxiosError', {
|
|
15523
|
-
value: true
|
|
15524
|
-
});
|
|
15525
|
-
|
|
15526
|
-
// eslint-disable-next-line func-names
|
|
15527
|
-
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
15528
|
-
const axiosError = Object.create(prototype$1);
|
|
15529
|
-
utils$1$1.toFlatObject(error, axiosError, function filter(obj) {
|
|
15530
|
-
return obj !== Error.prototype;
|
|
15531
|
-
}, prop => {
|
|
15532
|
-
return prop !== 'isAxiosError';
|
|
15533
|
-
});
|
|
15534
|
-
const msg = error && error.message ? error.message : 'Error';
|
|
15534
|
+
}
|
|
15535
15535
|
|
|
15536
|
-
|
|
15537
|
-
|
|
15538
|
-
|
|
15539
|
-
|
|
15540
|
-
|
|
15541
|
-
|
|
15542
|
-
|
|
15543
|
-
|
|
15544
|
-
|
|
15545
|
-
|
|
15546
|
-
|
|
15547
|
-
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
};
|
|
15536
|
+
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
15537
|
+
AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
15538
|
+
AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
15539
|
+
AxiosError.ECONNABORTED = 'ECONNABORTED';
|
|
15540
|
+
AxiosError.ETIMEDOUT = 'ETIMEDOUT';
|
|
15541
|
+
AxiosError.ERR_NETWORK = 'ERR_NETWORK';
|
|
15542
|
+
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
15543
|
+
AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
15544
|
+
AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
15545
|
+
AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
15546
|
+
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
15547
|
+
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
15548
|
+
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
15549
|
+
const AxiosError$1 = AxiosError;
|
|
15551
15550
|
|
|
15552
15551
|
/**
|
|
15553
15552
|
* Determines if the given thing is a array or js object.
|
|
@@ -15662,7 +15661,7 @@ function toFormData(obj, formData, options) {
|
|
|
15662
15661
|
return value.toString();
|
|
15663
15662
|
}
|
|
15664
15663
|
if (!useBlob && utils$1$1.isBlob(value)) {
|
|
15665
|
-
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
15664
|
+
throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
|
|
15666
15665
|
}
|
|
15667
15666
|
if (utils$1$1.isArrayBuffer(value) || utils$1$1.isTypedArray(value)) {
|
|
15668
15667
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
@@ -15802,22 +15801,19 @@ function encode$2(val) {
|
|
|
15802
15801
|
* @returns {string} The formatted url
|
|
15803
15802
|
*/
|
|
15804
15803
|
function buildURL(url, params, options) {
|
|
15805
|
-
/*eslint no-param-reassign:0*/
|
|
15806
15804
|
if (!params) {
|
|
15807
15805
|
return url;
|
|
15808
15806
|
}
|
|
15809
15807
|
const _encode = options && options.encode || encode$2;
|
|
15810
|
-
|
|
15811
|
-
options
|
|
15812
|
-
|
|
15813
|
-
|
|
15814
|
-
}
|
|
15815
|
-
const serializeFn = options && options.serialize;
|
|
15808
|
+
const _options = utils$1$1.isFunction(options) ? {
|
|
15809
|
+
serialize: options
|
|
15810
|
+
} : options;
|
|
15811
|
+
const serializeFn = _options && _options.serialize;
|
|
15816
15812
|
let serializedParams;
|
|
15817
15813
|
if (serializeFn) {
|
|
15818
|
-
serializedParams = serializeFn(params,
|
|
15814
|
+
serializedParams = serializeFn(params, _options);
|
|
15819
15815
|
} else {
|
|
15820
|
-
serializedParams = utils$1$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params,
|
|
15816
|
+
serializedParams = utils$1$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
15821
15817
|
}
|
|
15822
15818
|
if (serializedParams) {
|
|
15823
15819
|
const hashmarkIndex = url.indexOf("#");
|
|
@@ -15838,6 +15834,7 @@ class InterceptorManager {
|
|
|
15838
15834
|
*
|
|
15839
15835
|
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
15840
15836
|
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
15837
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
15841
15838
|
*
|
|
15842
15839
|
* @return {Number} An ID used to remove interceptor later
|
|
15843
15840
|
*/
|
|
@@ -15897,7 +15894,8 @@ const InterceptorManager$1 = InterceptorManager;
|
|
|
15897
15894
|
const transitionalDefaults = {
|
|
15898
15895
|
silentJSONParsing: true,
|
|
15899
15896
|
forcedJSONParsing: true,
|
|
15900
|
-
clarifyTimeoutError: false
|
|
15897
|
+
clarifyTimeoutError: false,
|
|
15898
|
+
legacyInterceptorReqResOrdering: true
|
|
15901
15899
|
};
|
|
15902
15900
|
const URLSearchParams$1 = url__default["default"].URLSearchParams;
|
|
15903
15901
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
@@ -16146,7 +16144,7 @@ const defaults$2 = {
|
|
|
16146
16144
|
} catch (e) {
|
|
16147
16145
|
if (strictJSONParsing) {
|
|
16148
16146
|
if (e.name === 'SyntaxError') {
|
|
16149
|
-
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
|
|
16147
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
16150
16148
|
}
|
|
16151
16149
|
throw e;
|
|
16152
16150
|
}
|
|
@@ -16480,24 +16478,23 @@ function transformData(fns, response) {
|
|
|
16480
16478
|
function isCancel(value) {
|
|
16481
16479
|
return !!(value && value.__CANCEL__);
|
|
16482
16480
|
}
|
|
16483
|
-
|
|
16484
|
-
/**
|
|
16485
|
-
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16481
|
+
class CanceledError extends AxiosError$1 {
|
|
16482
|
+
/**
|
|
16483
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
16484
|
+
*
|
|
16485
|
+
* @param {string=} message The message.
|
|
16486
|
+
* @param {Object=} config The config.
|
|
16487
|
+
* @param {Object=} request The request.
|
|
16488
|
+
*
|
|
16489
|
+
* @returns {CanceledError} The created error.
|
|
16490
|
+
*/
|
|
16491
|
+
constructor(message, config, request) {
|
|
16492
|
+
super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
|
|
16493
|
+
this.name = 'CanceledError';
|
|
16494
|
+
this.__CANCEL__ = true;
|
|
16495
|
+
}
|
|
16497
16496
|
}
|
|
16498
|
-
|
|
16499
|
-
__CANCEL__: true
|
|
16500
|
-
});
|
|
16497
|
+
const CanceledError$1 = CanceledError;
|
|
16501
16498
|
|
|
16502
16499
|
/**
|
|
16503
16500
|
* Resolve or reject a Promise based on response status.
|
|
@@ -16513,7 +16510,7 @@ function settle(resolve, reject, response) {
|
|
|
16513
16510
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
16514
16511
|
resolve(response);
|
|
16515
16512
|
} else {
|
|
16516
|
-
reject(new AxiosError('Request failed with status code ' + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
16513
|
+
reject(new AxiosError$1('Request failed with status code ' + response.status, [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
16517
16514
|
}
|
|
16518
16515
|
}
|
|
16519
16516
|
|
|
@@ -16528,6 +16525,9 @@ function isAbsoluteURL(url) {
|
|
|
16528
16525
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
16529
16526
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
16530
16527
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
16528
|
+
if (typeof url !== 'string') {
|
|
16529
|
+
return false;
|
|
16530
|
+
}
|
|
16531
16531
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
16532
16532
|
}
|
|
16533
16533
|
|
|
@@ -16560,7 +16560,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
|
16560
16560
|
}
|
|
16561
16561
|
return requestedURL;
|
|
16562
16562
|
}
|
|
16563
|
-
const VERSION = "1.13.
|
|
16563
|
+
const VERSION = "1.13.5";
|
|
16564
16564
|
function parseProtocol(url) {
|
|
16565
16565
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
16566
16566
|
return match && match[1] || '';
|
|
@@ -16587,7 +16587,7 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
16587
16587
|
uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
|
|
16588
16588
|
const match = DATA_URL_PATTERN.exec(uri);
|
|
16589
16589
|
if (!match) {
|
|
16590
|
-
throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);
|
|
16590
|
+
throw new AxiosError$1('Invalid URL', AxiosError$1.ERR_INVALID_URL);
|
|
16591
16591
|
}
|
|
16592
16592
|
const mime = match[1];
|
|
16593
16593
|
const isBase64 = match[2];
|
|
@@ -16595,7 +16595,7 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
16595
16595
|
const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');
|
|
16596
16596
|
if (asBlob) {
|
|
16597
16597
|
if (!_Blob) {
|
|
16598
|
-
throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
|
|
16598
|
+
throw new AxiosError$1('Blob is not supported', AxiosError$1.ERR_NOT_SUPPORT);
|
|
16599
16599
|
}
|
|
16600
16600
|
return new _Blob([buffer], {
|
|
16601
16601
|
type: mime
|
|
@@ -16603,7 +16603,7 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
16603
16603
|
}
|
|
16604
16604
|
return buffer;
|
|
16605
16605
|
}
|
|
16606
|
-
throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
|
|
16606
|
+
throw new AxiosError$1('Unsupported protocol ' + protocol, AxiosError$1.ERR_NOT_SUPPORT);
|
|
16607
16607
|
}
|
|
16608
16608
|
const kInternals = Symbol('internals');
|
|
16609
16609
|
class AxiosTransformStream extends stream__default["default"].Transform {
|
|
@@ -17166,8 +17166,13 @@ function setProxy(options, configProxy, location) {
|
|
|
17166
17166
|
}
|
|
17167
17167
|
if (proxy.auth) {
|
|
17168
17168
|
// Support proxy auth object form
|
|
17169
|
-
|
|
17169
|
+
const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password);
|
|
17170
|
+
if (validProxyAuth) {
|
|
17170
17171
|
proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
|
|
17172
|
+
} else if (typeof proxy.auth === 'object') {
|
|
17173
|
+
throw new AxiosError$1('Invalid proxy authorization', AxiosError$1.ERR_BAD_OPTION, {
|
|
17174
|
+
proxy
|
|
17175
|
+
});
|
|
17171
17176
|
}
|
|
17172
17177
|
const base64 = Buffer.from(proxy.auth, 'utf8').toString('base64');
|
|
17173
17178
|
options.headers['Proxy-Authorization'] = 'Basic ' + base64;
|
|
@@ -17231,7 +17236,7 @@ const buildAddressEntry = (address, family) => resolveFamily(utils$1$1.isObject(
|
|
|
17231
17236
|
});
|
|
17232
17237
|
const http2Transport = {
|
|
17233
17238
|
request(options, cb) {
|
|
17234
|
-
const authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80);
|
|
17239
|
+
const authority = options.protocol + '//' + options.hostname + ':' + (options.port || (options.protocol === 'https:' ? 443 : 80));
|
|
17235
17240
|
const {
|
|
17236
17241
|
http2Options,
|
|
17237
17242
|
headers
|
|
@@ -17308,7 +17313,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17308
17313
|
const abortEmitter = new events.EventEmitter();
|
|
17309
17314
|
function abort(reason) {
|
|
17310
17315
|
try {
|
|
17311
|
-
abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
|
|
17316
|
+
abortEmitter.emit('abort', !reason || reason.type ? new CanceledError$1(null, config, req) : reason);
|
|
17312
17317
|
} catch (err) {
|
|
17313
17318
|
console.warn('emit error', err);
|
|
17314
17319
|
}
|
|
@@ -17360,7 +17365,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17360
17365
|
const dataUrl = String(config.url || fullPath || '');
|
|
17361
17366
|
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
17362
17367
|
if (estimated > config.maxContentLength) {
|
|
17363
|
-
return reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config));
|
|
17368
|
+
return reject(new AxiosError$1('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError$1.ERR_BAD_RESPONSE, config));
|
|
17364
17369
|
}
|
|
17365
17370
|
}
|
|
17366
17371
|
let convertedData;
|
|
@@ -17377,7 +17382,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17377
17382
|
Blob: config.env && config.env.Blob
|
|
17378
17383
|
});
|
|
17379
17384
|
} catch (err) {
|
|
17380
|
-
throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
|
|
17385
|
+
throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
|
|
17381
17386
|
}
|
|
17382
17387
|
if (responseType === 'text') {
|
|
17383
17388
|
convertedData = convertedData.toString(responseEncoding);
|
|
@@ -17396,7 +17401,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17396
17401
|
});
|
|
17397
17402
|
}
|
|
17398
17403
|
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
17399
|
-
return reject(new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config));
|
|
17404
|
+
return reject(new AxiosError$1('Unsupported protocol ' + protocol, AxiosError$1.ERR_BAD_REQUEST, config));
|
|
17400
17405
|
}
|
|
17401
17406
|
const headers = AxiosHeaders$1.from(config.headers).normalize();
|
|
17402
17407
|
|
|
@@ -17442,13 +17447,13 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17442
17447
|
} else if (utils$1$1.isString(data)) {
|
|
17443
17448
|
data = Buffer.from(data, 'utf-8');
|
|
17444
17449
|
} else {
|
|
17445
|
-
return reject(new AxiosError('Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', AxiosError.ERR_BAD_REQUEST, config));
|
|
17450
|
+
return reject(new AxiosError$1('Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', AxiosError$1.ERR_BAD_REQUEST, config));
|
|
17446
17451
|
}
|
|
17447
17452
|
|
|
17448
17453
|
// Add Content-Length header if data exists
|
|
17449
17454
|
headers.setContentLength(data.length, false);
|
|
17450
17455
|
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
17451
|
-
return reject(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config));
|
|
17456
|
+
return reject(new AxiosError$1('Request body larger than maxBodyLength limit', AxiosError$1.ERR_BAD_REQUEST, config));
|
|
17452
17457
|
}
|
|
17453
17458
|
}
|
|
17454
17459
|
const contentLength = utils$1$1.toFiniteNumber(headers.getContentLength());
|
|
@@ -17626,20 +17631,20 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17626
17631
|
// stream.destroy() emit aborted event before calling reject() on Node.js v16
|
|
17627
17632
|
rejected = true;
|
|
17628
17633
|
responseStream.destroy();
|
|
17629
|
-
abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
|
|
17634
|
+
abort(new AxiosError$1('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest));
|
|
17630
17635
|
}
|
|
17631
17636
|
});
|
|
17632
17637
|
responseStream.on('aborted', function handlerStreamAborted() {
|
|
17633
17638
|
if (rejected) {
|
|
17634
17639
|
return;
|
|
17635
17640
|
}
|
|
17636
|
-
const err = new AxiosError('stream has been aborted', AxiosError.ERR_BAD_RESPONSE, config, lastRequest);
|
|
17641
|
+
const err = new AxiosError$1('stream has been aborted', AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest);
|
|
17637
17642
|
responseStream.destroy(err);
|
|
17638
17643
|
reject(err);
|
|
17639
17644
|
});
|
|
17640
17645
|
responseStream.on('error', function handleStreamError(err) {
|
|
17641
17646
|
if (req.destroyed) return;
|
|
17642
|
-
reject(AxiosError.from(err, null, config, lastRequest));
|
|
17647
|
+
reject(AxiosError$1.from(err, null, config, lastRequest));
|
|
17643
17648
|
});
|
|
17644
17649
|
responseStream.on('end', function handleStreamEnd() {
|
|
17645
17650
|
try {
|
|
@@ -17652,7 +17657,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17652
17657
|
}
|
|
17653
17658
|
response.data = responseData;
|
|
17654
17659
|
} catch (err) {
|
|
17655
|
-
return reject(AxiosError.from(err, null, config, response.request, response));
|
|
17660
|
+
return reject(AxiosError$1.from(err, null, config, response.request, response));
|
|
17656
17661
|
}
|
|
17657
17662
|
settle(resolve, reject, response);
|
|
17658
17663
|
});
|
|
@@ -17674,9 +17679,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17674
17679
|
|
|
17675
17680
|
// Handle errors
|
|
17676
17681
|
req.on('error', function handleRequestError(err) {
|
|
17677
|
-
|
|
17678
|
-
// if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
|
|
17679
|
-
reject(AxiosError.from(err, null, config, req));
|
|
17682
|
+
reject(AxiosError$1.from(err, null, config, req));
|
|
17680
17683
|
});
|
|
17681
17684
|
|
|
17682
17685
|
// set tcp keep alive to prevent drop connection by peer
|
|
@@ -17690,7 +17693,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17690
17693
|
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
|
|
17691
17694
|
const timeout = parseInt(config.timeout, 10);
|
|
17692
17695
|
if (Number.isNaN(timeout)) {
|
|
17693
|
-
abort(new AxiosError('error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req));
|
|
17696
|
+
abort(new AxiosError$1('error trying to parse `config.timeout` to int', AxiosError$1.ERR_BAD_OPTION_VALUE, config, req));
|
|
17694
17697
|
return;
|
|
17695
17698
|
}
|
|
17696
17699
|
|
|
@@ -17706,7 +17709,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17706
17709
|
if (config.timeoutErrorMessage) {
|
|
17707
17710
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
17708
17711
|
}
|
|
17709
|
-
abort(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req));
|
|
17712
|
+
abort(new AxiosError$1(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, req));
|
|
17710
17713
|
});
|
|
17711
17714
|
} else {
|
|
17712
17715
|
// explicitly reset the socket timeout value for a possible `keep-alive` request
|
|
@@ -17726,7 +17729,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
17726
17729
|
});
|
|
17727
17730
|
data.on('close', () => {
|
|
17728
17731
|
if (!ended && !errored) {
|
|
17729
|
-
abort(new CanceledError('Request stream has been aborted', config, req));
|
|
17732
|
+
abort(new CanceledError$1('Request stream has been aborted', config, req));
|
|
17730
17733
|
}
|
|
17731
17734
|
});
|
|
17732
17735
|
data.pipe(req);
|
|
@@ -17807,8 +17810,6 @@ function mergeConfig(config1, config2) {
|
|
|
17807
17810
|
}
|
|
17808
17811
|
return source;
|
|
17809
17812
|
}
|
|
17810
|
-
|
|
17811
|
-
// eslint-disable-next-line consistent-return
|
|
17812
17813
|
function mergeDeepProperties(a, b, prop, caseless) {
|
|
17813
17814
|
if (!utils$1$1.isUndefined(b)) {
|
|
17814
17815
|
return getMergedValue(a, b, prop, caseless);
|
|
@@ -17873,7 +17874,8 @@ function mergeConfig(config1, config2) {
|
|
|
17873
17874
|
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
17874
17875
|
};
|
|
17875
17876
|
utils$1$1.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) {
|
|
17876
|
-
|
|
17877
|
+
if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
|
|
17878
|
+
const merge = utils$1$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
17877
17879
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
17878
17880
|
utils$1$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
|
17879
17881
|
});
|
|
@@ -18008,7 +18010,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
18008
18010
|
if (!request) {
|
|
18009
18011
|
return;
|
|
18010
18012
|
}
|
|
18011
|
-
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
|
18013
|
+
reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
|
|
18012
18014
|
|
|
18013
18015
|
// Clean up request
|
|
18014
18016
|
request = null;
|
|
@@ -18020,7 +18022,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
18020
18022
|
// (message may be empty; when present, surface it)
|
|
18021
18023
|
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
18022
18024
|
const msg = event && event.message ? event.message : 'Network Error';
|
|
18023
|
-
const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
|
|
18025
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
18024
18026
|
// attach the underlying event for consumers who want details
|
|
18025
18027
|
err.event = event || null;
|
|
18026
18028
|
reject(err);
|
|
@@ -18034,7 +18036,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
18034
18036
|
if (_config.timeoutErrorMessage) {
|
|
18035
18037
|
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
18036
18038
|
}
|
|
18037
|
-
reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
|
|
18039
|
+
reject(new AxiosError$1(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, config, request));
|
|
18038
18040
|
|
|
18039
18041
|
// Clean up request
|
|
18040
18042
|
request = null;
|
|
@@ -18079,7 +18081,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
18079
18081
|
if (!request) {
|
|
18080
18082
|
return;
|
|
18081
18083
|
}
|
|
18082
|
-
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
18084
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
18083
18085
|
request.abort();
|
|
18084
18086
|
request = null;
|
|
18085
18087
|
};
|
|
@@ -18090,7 +18092,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
18090
18092
|
}
|
|
18091
18093
|
const protocol = parseProtocol(_config.url);
|
|
18092
18094
|
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
18093
|
-
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
18095
|
+
reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
|
|
18094
18096
|
return;
|
|
18095
18097
|
}
|
|
18096
18098
|
|
|
@@ -18110,12 +18112,12 @@ const composeSignals = (signals, timeout) => {
|
|
|
18110
18112
|
aborted = true;
|
|
18111
18113
|
unsubscribe();
|
|
18112
18114
|
const err = reason instanceof Error ? reason : this.reason;
|
|
18113
|
-
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
18115
|
+
controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
|
|
18114
18116
|
}
|
|
18115
18117
|
};
|
|
18116
18118
|
let timer = timeout && setTimeout(() => {
|
|
18117
18119
|
timer = null;
|
|
18118
|
-
onabort(new AxiosError(`timeout ${timeout}
|
|
18120
|
+
onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
18119
18121
|
}, timeout);
|
|
18120
18122
|
const unsubscribe = () => {
|
|
18121
18123
|
if (signals) {
|
|
@@ -18310,7 +18312,7 @@ const factory = env => {
|
|
|
18310
18312
|
if (method) {
|
|
18311
18313
|
return method.call(res);
|
|
18312
18314
|
}
|
|
18313
|
-
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
18315
|
+
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
18314
18316
|
});
|
|
18315
18317
|
});
|
|
18316
18318
|
})();
|
|
@@ -18427,11 +18429,11 @@ const factory = env => {
|
|
|
18427
18429
|
} catch (err) {
|
|
18428
18430
|
unsubscribe && unsubscribe();
|
|
18429
18431
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
18430
|
-
throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), {
|
|
18432
|
+
throw Object.assign(new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response), {
|
|
18431
18433
|
cause: err.cause || err
|
|
18432
18434
|
});
|
|
18433
18435
|
}
|
|
18434
|
-
throw AxiosError.from(err, err && err.code, config, request);
|
|
18436
|
+
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
18435
18437
|
}
|
|
18436
18438
|
};
|
|
18437
18439
|
};
|
|
@@ -18533,7 +18535,7 @@ function getAdapter(adapters, config) {
|
|
|
18533
18535
|
if (!isResolvedHandle(nameOrAdapter)) {
|
|
18534
18536
|
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
18535
18537
|
if (adapter === undefined) {
|
|
18536
|
-
throw new AxiosError(`Unknown adapter '${id}'`);
|
|
18538
|
+
throw new AxiosError$1(`Unknown adapter '${id}'`);
|
|
18537
18539
|
}
|
|
18538
18540
|
}
|
|
18539
18541
|
if (adapter && (utils$1$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
@@ -18544,7 +18546,7 @@ function getAdapter(adapters, config) {
|
|
|
18544
18546
|
if (!adapter) {
|
|
18545
18547
|
const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build'));
|
|
18546
18548
|
let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified';
|
|
18547
|
-
throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT');
|
|
18549
|
+
throw new AxiosError$1(`There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT');
|
|
18548
18550
|
}
|
|
18549
18551
|
return adapter;
|
|
18550
18552
|
}
|
|
@@ -18577,7 +18579,7 @@ function throwIfCancellationRequested(config) {
|
|
|
18577
18579
|
config.cancelToken.throwIfRequested();
|
|
18578
18580
|
}
|
|
18579
18581
|
if (config.signal && config.signal.aborted) {
|
|
18580
|
-
throw new CanceledError(null, config);
|
|
18582
|
+
throw new CanceledError$1(null, config);
|
|
18581
18583
|
}
|
|
18582
18584
|
}
|
|
18583
18585
|
|
|
@@ -18645,7 +18647,7 @@ validators$1.transitional = function transitional(validator, version, message) {
|
|
|
18645
18647
|
// eslint-disable-next-line func-names
|
|
18646
18648
|
return (value, opt, opts) => {
|
|
18647
18649
|
if (validator === false) {
|
|
18648
|
-
throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED);
|
|
18650
|
+
throw new AxiosError$1(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError$1.ERR_DEPRECATED);
|
|
18649
18651
|
}
|
|
18650
18652
|
if (version && !deprecatedWarnings[opt]) {
|
|
18651
18653
|
deprecatedWarnings[opt] = true;
|
|
@@ -18675,7 +18677,7 @@ validators$1.spelling = function spelling(correctSpelling) {
|
|
|
18675
18677
|
|
|
18676
18678
|
function assertOptions(options, schema, allowUnknown) {
|
|
18677
18679
|
if (typeof options !== 'object') {
|
|
18678
|
-
throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
|
|
18680
|
+
throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
18679
18681
|
}
|
|
18680
18682
|
const keys = Object.keys(options);
|
|
18681
18683
|
let i = keys.length;
|
|
@@ -18686,12 +18688,12 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
18686
18688
|
const value = options[opt];
|
|
18687
18689
|
const result = value === undefined || validator(value, opt, options);
|
|
18688
18690
|
if (result !== true) {
|
|
18689
|
-
throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
|
|
18691
|
+
throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
18690
18692
|
}
|
|
18691
18693
|
continue;
|
|
18692
18694
|
}
|
|
18693
18695
|
if (allowUnknown !== true) {
|
|
18694
|
-
throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
|
|
18696
|
+
throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
|
|
18695
18697
|
}
|
|
18696
18698
|
}
|
|
18697
18699
|
}
|
|
@@ -18768,7 +18770,8 @@ class Axios {
|
|
|
18768
18770
|
validator.assertOptions(transitional, {
|
|
18769
18771
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
18770
18772
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
18771
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
18773
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
18774
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
18772
18775
|
}, false);
|
|
18773
18776
|
}
|
|
18774
18777
|
if (paramsSerializer != null) {
|
|
@@ -18813,7 +18816,13 @@ class Axios {
|
|
|
18813
18816
|
return;
|
|
18814
18817
|
}
|
|
18815
18818
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
18816
|
-
|
|
18819
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
18820
|
+
const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
|
|
18821
|
+
if (legacyInterceptorReqResOrdering) {
|
|
18822
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
18823
|
+
} else {
|
|
18824
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
18825
|
+
}
|
|
18817
18826
|
});
|
|
18818
18827
|
const responseInterceptorChain = [];
|
|
18819
18828
|
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
@@ -18941,7 +18950,7 @@ class CancelToken {
|
|
|
18941
18950
|
// Cancellation has already been requested
|
|
18942
18951
|
return;
|
|
18943
18952
|
}
|
|
18944
|
-
token.reason = new CanceledError(message, config, request);
|
|
18953
|
+
token.reason = new CanceledError$1(message, config, request);
|
|
18945
18954
|
resolvePromise(token.reason);
|
|
18946
18955
|
});
|
|
18947
18956
|
}
|
|
@@ -19018,7 +19027,7 @@ const CancelToken$1 = CancelToken;
|
|
|
19018
19027
|
*
|
|
19019
19028
|
* ```js
|
|
19020
19029
|
* function f(x, y, z) {}
|
|
19021
|
-
*
|
|
19030
|
+
* const args = [1, 2, 3];
|
|
19022
19031
|
* f.apply(null, args);
|
|
19023
19032
|
* ```
|
|
19024
19033
|
*
|
|
@@ -19159,14 +19168,14 @@ const axios = createInstance(defaults$1$1);
|
|
|
19159
19168
|
axios.Axios = Axios$1;
|
|
19160
19169
|
|
|
19161
19170
|
// Expose Cancel & CancelToken
|
|
19162
|
-
axios.CanceledError = CanceledError;
|
|
19171
|
+
axios.CanceledError = CanceledError$1;
|
|
19163
19172
|
axios.CancelToken = CancelToken$1;
|
|
19164
19173
|
axios.isCancel = isCancel;
|
|
19165
19174
|
axios.VERSION = VERSION;
|
|
19166
19175
|
axios.toFormData = toFormData;
|
|
19167
19176
|
|
|
19168
19177
|
// Expose AxiosError class
|
|
19169
|
-
axios.AxiosError = AxiosError;
|
|
19178
|
+
axios.AxiosError = AxiosError$1;
|
|
19170
19179
|
|
|
19171
19180
|
// alias for CanceledError for backward compatibility
|
|
19172
19181
|
axios.Cancel = axios.CanceledError;
|
|
@@ -20958,7 +20967,7 @@ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
|
|
|
20958
20967
|
var hexTable = function () {
|
|
20959
20968
|
var array = [];
|
|
20960
20969
|
for (var i = 0; i < 256; ++i) {
|
|
20961
|
-
array.
|
|
20970
|
+
array[array.length] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
|
|
20962
20971
|
}
|
|
20963
20972
|
return array;
|
|
20964
20973
|
}();
|
|
@@ -20970,7 +20979,7 @@ var compactQueue = function compactQueue(queue) {
|
|
|
20970
20979
|
var compacted = [];
|
|
20971
20980
|
for (var j = 0; j < obj.length; ++j) {
|
|
20972
20981
|
if (typeof obj[j] !== 'undefined') {
|
|
20973
|
-
compacted.
|
|
20982
|
+
compacted[compacted.length] = obj[j];
|
|
20974
20983
|
}
|
|
20975
20984
|
}
|
|
20976
20985
|
item.obj[item.prop] = compacted;
|
|
@@ -20995,7 +21004,11 @@ var merge = function merge(target, source, options) {
|
|
|
20995
21004
|
}
|
|
20996
21005
|
if (typeof source !== 'object' && typeof source !== 'function') {
|
|
20997
21006
|
if (isArray$2(target)) {
|
|
20998
|
-
target.
|
|
21007
|
+
var nextIndex = target.length;
|
|
21008
|
+
if (options && typeof options.arrayLimit === 'number' && nextIndex > options.arrayLimit) {
|
|
21009
|
+
return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
|
|
21010
|
+
}
|
|
21011
|
+
target[nextIndex] = source;
|
|
20999
21012
|
} else if (target && typeof target === 'object') {
|
|
21000
21013
|
if (isOverflow(target)) {
|
|
21001
21014
|
// Add at next numeric index for overflow objects
|
|
@@ -21026,7 +21039,11 @@ var merge = function merge(target, source, options) {
|
|
|
21026
21039
|
}
|
|
21027
21040
|
return markOverflow(result, getMaxIndex(source) + 1);
|
|
21028
21041
|
}
|
|
21029
|
-
|
|
21042
|
+
var combined = [target].concat(source);
|
|
21043
|
+
if (options && typeof options.arrayLimit === 'number' && combined.length > options.arrayLimit) {
|
|
21044
|
+
return markOverflow(arrayToObject(combined, options), combined.length - 1);
|
|
21045
|
+
}
|
|
21046
|
+
return combined;
|
|
21030
21047
|
}
|
|
21031
21048
|
var mergeTarget = target;
|
|
21032
21049
|
if (isArray$2(target) && !isArray$2(source)) {
|
|
@@ -21039,7 +21056,7 @@ var merge = function merge(target, source, options) {
|
|
|
21039
21056
|
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
21040
21057
|
target[i] = merge(targetItem, item, options);
|
|
21041
21058
|
} else {
|
|
21042
|
-
target.
|
|
21059
|
+
target[target.length] = item;
|
|
21043
21060
|
}
|
|
21044
21061
|
} else {
|
|
21045
21062
|
target[i] = item;
|
|
@@ -21054,6 +21071,15 @@ var merge = function merge(target, source, options) {
|
|
|
21054
21071
|
} else {
|
|
21055
21072
|
acc[key] = value;
|
|
21056
21073
|
}
|
|
21074
|
+
if (isOverflow(source) && !isOverflow(acc)) {
|
|
21075
|
+
markOverflow(acc, getMaxIndex(source));
|
|
21076
|
+
}
|
|
21077
|
+
if (isOverflow(acc)) {
|
|
21078
|
+
var keyNum = parseInt(key, 10);
|
|
21079
|
+
if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {
|
|
21080
|
+
setMaxIndex(acc, keyNum);
|
|
21081
|
+
}
|
|
21082
|
+
}
|
|
21057
21083
|
return acc;
|
|
21058
21084
|
}, mergeTarget);
|
|
21059
21085
|
};
|
|
@@ -21151,11 +21177,11 @@ var compact = function compact(value) {
|
|
|
21151
21177
|
var key = keys[j];
|
|
21152
21178
|
var val = obj[key];
|
|
21153
21179
|
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
21154
|
-
queue.
|
|
21180
|
+
queue[queue.length] = {
|
|
21155
21181
|
obj: obj,
|
|
21156
21182
|
prop: key
|
|
21157
|
-
}
|
|
21158
|
-
refs.
|
|
21183
|
+
};
|
|
21184
|
+
refs[refs.length] = val;
|
|
21159
21185
|
}
|
|
21160
21186
|
}
|
|
21161
21187
|
}
|
|
@@ -21191,7 +21217,7 @@ var maybeMap = function maybeMap(val, fn) {
|
|
|
21191
21217
|
if (isArray$2(val)) {
|
|
21192
21218
|
var mapped = [];
|
|
21193
21219
|
for (var i = 0; i < val.length; i += 1) {
|
|
21194
|
-
mapped.
|
|
21220
|
+
mapped[mapped.length] = fn(val[i]);
|
|
21195
21221
|
}
|
|
21196
21222
|
return mapped;
|
|
21197
21223
|
}
|
|
@@ -21207,6 +21233,7 @@ var utils$2 = {
|
|
|
21207
21233
|
isBuffer: isBuffer,
|
|
21208
21234
|
isOverflow: isOverflow,
|
|
21209
21235
|
isRegExp: isRegExp,
|
|
21236
|
+
markOverflow: markOverflow,
|
|
21210
21237
|
maybeMap: maybeMap,
|
|
21211
21238
|
merge: merge
|
|
21212
21239
|
};
|
|
@@ -21513,7 +21540,7 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
21513
21540
|
};
|
|
21514
21541
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
21515
21542
|
cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
|
|
21516
|
-
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
21543
|
+
var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;
|
|
21517
21544
|
var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded ? limit + 1 : limit);
|
|
21518
21545
|
if (options.throwOnLimitExceeded && parts.length > limit) {
|
|
21519
21546
|
throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
|
|
@@ -21560,6 +21587,12 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
21560
21587
|
if (part.indexOf('[]=') > -1) {
|
|
21561
21588
|
val = isArray(val) ? [val] : val;
|
|
21562
21589
|
}
|
|
21590
|
+
if (options.comma && isArray(val) && val.length > options.arrayLimit) {
|
|
21591
|
+
if (options.throwOnLimitExceeded) {
|
|
21592
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
21593
|
+
}
|
|
21594
|
+
val = utils.combine([], val, options.arrayLimit, options.plainObjects);
|
|
21595
|
+
}
|
|
21563
21596
|
if (key !== null) {
|
|
21564
21597
|
var existing = has.call(obj, key);
|
|
21565
21598
|
if (existing && options.duplicates === 'combine') {
|
|
@@ -21595,13 +21628,19 @@ var parseObject = function (chain, val, options, valuesParsed) {
|
|
|
21595
21628
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
21596
21629
|
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
|
|
21597
21630
|
var index = parseInt(decodedRoot, 10);
|
|
21631
|
+
var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
|
|
21598
21632
|
if (!options.parseArrays && decodedRoot === '') {
|
|
21599
21633
|
obj = {
|
|
21600
21634
|
0: leaf
|
|
21601
21635
|
};
|
|
21602
|
-
} else if (
|
|
21636
|
+
} else if (isValidArrayIndex && index < options.arrayLimit) {
|
|
21603
21637
|
obj = [];
|
|
21604
21638
|
obj[index] = leaf;
|
|
21639
|
+
} else if (isValidArrayIndex && options.throwOnLimitExceeded) {
|
|
21640
|
+
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
|
|
21641
|
+
} else if (isValidArrayIndex) {
|
|
21642
|
+
obj[index] = leaf;
|
|
21643
|
+
utils.markOverflow(obj, index);
|
|
21605
21644
|
} else if (decodedRoot !== '__proto__') {
|
|
21606
21645
|
obj[decodedRoot] = leaf;
|
|
21607
21646
|
}
|
|
@@ -21631,7 +21670,7 @@ var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
|
|
|
21631
21670
|
return;
|
|
21632
21671
|
}
|
|
21633
21672
|
}
|
|
21634
|
-
keys.
|
|
21673
|
+
keys[keys.length] = parent;
|
|
21635
21674
|
}
|
|
21636
21675
|
var i = 0;
|
|
21637
21676
|
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
@@ -21642,13 +21681,13 @@ var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
|
|
|
21642
21681
|
return;
|
|
21643
21682
|
}
|
|
21644
21683
|
}
|
|
21645
|
-
keys.
|
|
21684
|
+
keys[keys.length] = segment[1];
|
|
21646
21685
|
}
|
|
21647
21686
|
if (segment) {
|
|
21648
21687
|
if (options.strictDepth === true) {
|
|
21649
21688
|
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
21650
21689
|
}
|
|
21651
|
-
keys.
|
|
21690
|
+
keys[keys.length] = '[' + key.slice(segment.index) + ']';
|
|
21652
21691
|
}
|
|
21653
21692
|
return keys;
|
|
21654
21693
|
};
|