@block52/poker-vm-sdk 1.1.6 → 1.1.7
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/index.d.ts +2 -1
- package/dist/index.esm.js +329 -263
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +329 -263
- package/dist/index.js.map +1 -1
- package/dist/types/game.d.ts +2 -1
- package/dist/types/game.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4191,30 +4191,30 @@ function bind(fn, thisArg) {
|
|
|
4191
4191
|
|
|
4192
4192
|
// utils is a library of generic helper functions non-specific to axios
|
|
4193
4193
|
|
|
4194
|
-
const {toString} = Object.prototype;
|
|
4195
|
-
const {getPrototypeOf} = Object;
|
|
4196
|
-
const {iterator, toStringTag} = Symbol;
|
|
4194
|
+
const { toString } = Object.prototype;
|
|
4195
|
+
const { getPrototypeOf } = Object;
|
|
4196
|
+
const { iterator, toStringTag } = Symbol;
|
|
4197
4197
|
|
|
4198
|
-
const kindOf = (cache => thing => {
|
|
4199
|
-
|
|
4200
|
-
|
|
4198
|
+
const kindOf = ((cache) => (thing) => {
|
|
4199
|
+
const str = toString.call(thing);
|
|
4200
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
4201
4201
|
})(Object.create(null));
|
|
4202
4202
|
|
|
4203
4203
|
const kindOfTest = (type) => {
|
|
4204
4204
|
type = type.toLowerCase();
|
|
4205
|
-
return (thing) => kindOf(thing) === type
|
|
4205
|
+
return (thing) => kindOf(thing) === type;
|
|
4206
4206
|
};
|
|
4207
4207
|
|
|
4208
|
-
const typeOfTest = type => thing => typeof thing === type;
|
|
4208
|
+
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
4209
4209
|
|
|
4210
4210
|
/**
|
|
4211
|
-
* Determine if a value is
|
|
4211
|
+
* Determine if a value is a non-null object
|
|
4212
4212
|
*
|
|
4213
4213
|
* @param {Object} val The value to test
|
|
4214
4214
|
*
|
|
4215
4215
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
4216
4216
|
*/
|
|
4217
|
-
const {isArray} = Array;
|
|
4217
|
+
const { isArray } = Array;
|
|
4218
4218
|
|
|
4219
4219
|
/**
|
|
4220
4220
|
* Determine if a value is undefined
|
|
@@ -4223,7 +4223,7 @@ const {isArray} = Array;
|
|
|
4223
4223
|
*
|
|
4224
4224
|
* @returns {boolean} True if the value is undefined, otherwise false
|
|
4225
4225
|
*/
|
|
4226
|
-
const isUndefined = typeOfTest(
|
|
4226
|
+
const isUndefined = typeOfTest("undefined");
|
|
4227
4227
|
|
|
4228
4228
|
/**
|
|
4229
4229
|
* Determine if a value is a Buffer
|
|
@@ -4233,8 +4233,14 @@ const isUndefined = typeOfTest('undefined');
|
|
|
4233
4233
|
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
4234
4234
|
*/
|
|
4235
4235
|
function isBuffer(val) {
|
|
4236
|
-
return
|
|
4237
|
-
|
|
4236
|
+
return (
|
|
4237
|
+
val !== null &&
|
|
4238
|
+
!isUndefined(val) &&
|
|
4239
|
+
val.constructor !== null &&
|
|
4240
|
+
!isUndefined(val.constructor) &&
|
|
4241
|
+
isFunction$1(val.constructor.isBuffer) &&
|
|
4242
|
+
val.constructor.isBuffer(val)
|
|
4243
|
+
);
|
|
4238
4244
|
}
|
|
4239
4245
|
|
|
4240
4246
|
/**
|
|
@@ -4244,8 +4250,7 @@ function isBuffer(val) {
|
|
|
4244
4250
|
*
|
|
4245
4251
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
4246
4252
|
*/
|
|
4247
|
-
const isArrayBuffer = kindOfTest(
|
|
4248
|
-
|
|
4253
|
+
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
4249
4254
|
|
|
4250
4255
|
/**
|
|
4251
4256
|
* Determine if a value is a view on an ArrayBuffer
|
|
@@ -4256,10 +4261,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
|
4256
4261
|
*/
|
|
4257
4262
|
function isArrayBufferView(val) {
|
|
4258
4263
|
let result;
|
|
4259
|
-
if (
|
|
4264
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
4260
4265
|
result = ArrayBuffer.isView(val);
|
|
4261
4266
|
} else {
|
|
4262
|
-
result =
|
|
4267
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
4263
4268
|
}
|
|
4264
4269
|
return result;
|
|
4265
4270
|
}
|
|
@@ -4271,7 +4276,7 @@ function isArrayBufferView(val) {
|
|
|
4271
4276
|
*
|
|
4272
4277
|
* @returns {boolean} True if value is a String, otherwise false
|
|
4273
4278
|
*/
|
|
4274
|
-
const isString = typeOfTest(
|
|
4279
|
+
const isString = typeOfTest("string");
|
|
4275
4280
|
|
|
4276
4281
|
/**
|
|
4277
4282
|
* Determine if a value is a Function
|
|
@@ -4279,7 +4284,7 @@ const isString = typeOfTest('string');
|
|
|
4279
4284
|
* @param {*} val The value to test
|
|
4280
4285
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
4281
4286
|
*/
|
|
4282
|
-
const isFunction$1 = typeOfTest(
|
|
4287
|
+
const isFunction$1 = typeOfTest("function");
|
|
4283
4288
|
|
|
4284
4289
|
/**
|
|
4285
4290
|
* Determine if a value is a Number
|
|
@@ -4288,7 +4293,7 @@ const isFunction$1 = typeOfTest('function');
|
|
|
4288
4293
|
*
|
|
4289
4294
|
* @returns {boolean} True if value is a Number, otherwise false
|
|
4290
4295
|
*/
|
|
4291
|
-
const isNumber = typeOfTest(
|
|
4296
|
+
const isNumber = typeOfTest("number");
|
|
4292
4297
|
|
|
4293
4298
|
/**
|
|
4294
4299
|
* Determine if a value is an Object
|
|
@@ -4297,7 +4302,7 @@ const isNumber = typeOfTest('number');
|
|
|
4297
4302
|
*
|
|
4298
4303
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
4299
4304
|
*/
|
|
4300
|
-
const isObject = (thing) => thing !== null && typeof thing ===
|
|
4305
|
+
const isObject = (thing) => thing !== null && typeof thing === "object";
|
|
4301
4306
|
|
|
4302
4307
|
/**
|
|
4303
4308
|
* Determine if a value is a Boolean
|
|
@@ -4305,7 +4310,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
|
4305
4310
|
* @param {*} thing The value to test
|
|
4306
4311
|
* @returns {boolean} True if value is a Boolean, otherwise false
|
|
4307
4312
|
*/
|
|
4308
|
-
const isBoolean = thing => thing === true || thing === false;
|
|
4313
|
+
const isBoolean = (thing) => thing === true || thing === false;
|
|
4309
4314
|
|
|
4310
4315
|
/**
|
|
4311
4316
|
* Determine if a value is a plain Object
|
|
@@ -4315,12 +4320,18 @@ const isBoolean = thing => thing === true || thing === false;
|
|
|
4315
4320
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
4316
4321
|
*/
|
|
4317
4322
|
const isPlainObject = (val) => {
|
|
4318
|
-
if (kindOf(val) !==
|
|
4323
|
+
if (kindOf(val) !== "object") {
|
|
4319
4324
|
return false;
|
|
4320
4325
|
}
|
|
4321
4326
|
|
|
4322
4327
|
const prototype = getPrototypeOf(val);
|
|
4323
|
-
return (
|
|
4328
|
+
return (
|
|
4329
|
+
(prototype === null ||
|
|
4330
|
+
prototype === Object.prototype ||
|
|
4331
|
+
Object.getPrototypeOf(prototype) === null) &&
|
|
4332
|
+
!(toStringTag in val) &&
|
|
4333
|
+
!(iterator in val)
|
|
4334
|
+
);
|
|
4324
4335
|
};
|
|
4325
4336
|
|
|
4326
4337
|
/**
|
|
@@ -4337,7 +4348,10 @@ const isEmptyObject = (val) => {
|
|
|
4337
4348
|
}
|
|
4338
4349
|
|
|
4339
4350
|
try {
|
|
4340
|
-
return
|
|
4351
|
+
return (
|
|
4352
|
+
Object.keys(val).length === 0 &&
|
|
4353
|
+
Object.getPrototypeOf(val) === Object.prototype
|
|
4354
|
+
);
|
|
4341
4355
|
} catch (e) {
|
|
4342
4356
|
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
4343
4357
|
return false;
|
|
@@ -4351,7 +4365,7 @@ const isEmptyObject = (val) => {
|
|
|
4351
4365
|
*
|
|
4352
4366
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
4353
4367
|
*/
|
|
4354
|
-
const isDate = kindOfTest(
|
|
4368
|
+
const isDate = kindOfTest("Date");
|
|
4355
4369
|
|
|
4356
4370
|
/**
|
|
4357
4371
|
* Determine if a value is a File
|
|
@@ -4360,7 +4374,7 @@ const isDate = kindOfTest('Date');
|
|
|
4360
4374
|
*
|
|
4361
4375
|
* @returns {boolean} True if value is a File, otherwise false
|
|
4362
4376
|
*/
|
|
4363
|
-
const isFile = kindOfTest(
|
|
4377
|
+
const isFile = kindOfTest("File");
|
|
4364
4378
|
|
|
4365
4379
|
/**
|
|
4366
4380
|
* Determine if a value is a Blob
|
|
@@ -4369,7 +4383,7 @@ const isFile = kindOfTest('File');
|
|
|
4369
4383
|
*
|
|
4370
4384
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
4371
4385
|
*/
|
|
4372
|
-
const isBlob = kindOfTest(
|
|
4386
|
+
const isBlob = kindOfTest("Blob");
|
|
4373
4387
|
|
|
4374
4388
|
/**
|
|
4375
4389
|
* Determine if a value is a FileList
|
|
@@ -4378,7 +4392,7 @@ const isBlob = kindOfTest('Blob');
|
|
|
4378
4392
|
*
|
|
4379
4393
|
* @returns {boolean} True if value is a File, otherwise false
|
|
4380
4394
|
*/
|
|
4381
|
-
const isFileList = kindOfTest(
|
|
4395
|
+
const isFileList = kindOfTest("FileList");
|
|
4382
4396
|
|
|
4383
4397
|
/**
|
|
4384
4398
|
* Determine if a value is a Stream
|
|
@@ -4398,15 +4412,16 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
|
4398
4412
|
*/
|
|
4399
4413
|
const isFormData = (thing) => {
|
|
4400
4414
|
let kind;
|
|
4401
|
-
return
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4415
|
+
return (
|
|
4416
|
+
thing &&
|
|
4417
|
+
((typeof FormData === "function" && thing instanceof FormData) ||
|
|
4418
|
+
(isFunction$1(thing.append) &&
|
|
4419
|
+
((kind = kindOf(thing)) === "formdata" ||
|
|
4420
|
+
// detect form-data instance
|
|
4421
|
+
(kind === "object" &&
|
|
4422
|
+
isFunction$1(thing.toString) &&
|
|
4423
|
+
thing.toString() === "[object FormData]"))))
|
|
4424
|
+
);
|
|
4410
4425
|
};
|
|
4411
4426
|
|
|
4412
4427
|
/**
|
|
@@ -4416,9 +4431,14 @@ const isFormData = (thing) => {
|
|
|
4416
4431
|
*
|
|
4417
4432
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
4418
4433
|
*/
|
|
4419
|
-
const isURLSearchParams = kindOfTest(
|
|
4434
|
+
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
4420
4435
|
|
|
4421
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
4436
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
4437
|
+
"ReadableStream",
|
|
4438
|
+
"Request",
|
|
4439
|
+
"Response",
|
|
4440
|
+
"Headers",
|
|
4441
|
+
].map(kindOfTest);
|
|
4422
4442
|
|
|
4423
4443
|
/**
|
|
4424
4444
|
* Trim excess whitespace off the beginning and end of a string
|
|
@@ -4427,8 +4447,8 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
|
|
|
4427
4447
|
*
|
|
4428
4448
|
* @returns {String} The String freed of excess whitespace
|
|
4429
4449
|
*/
|
|
4430
|
-
const trim = (str) =>
|
|
4431
|
-
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
|
4450
|
+
const trim = (str) =>
|
|
4451
|
+
str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
4432
4452
|
|
|
4433
4453
|
/**
|
|
4434
4454
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
@@ -4439,15 +4459,16 @@ const trim = (str) => str.trim ?
|
|
|
4439
4459
|
* If 'obj' is an Object callback will be called passing
|
|
4440
4460
|
* the value, key, and complete object for each property.
|
|
4441
4461
|
*
|
|
4442
|
-
* @param {Object|Array} obj The object to iterate
|
|
4462
|
+
* @param {Object|Array<unknown>} obj The object to iterate
|
|
4443
4463
|
* @param {Function} fn The callback to invoke for each item
|
|
4444
4464
|
*
|
|
4445
|
-
* @param {
|
|
4465
|
+
* @param {Object} [options]
|
|
4466
|
+
* @param {Boolean} [options.allOwnKeys = false]
|
|
4446
4467
|
* @returns {any}
|
|
4447
4468
|
*/
|
|
4448
|
-
function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
4469
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
4449
4470
|
// Don't bother if no value provided
|
|
4450
|
-
if (obj === null || typeof obj ===
|
|
4471
|
+
if (obj === null || typeof obj === "undefined") {
|
|
4451
4472
|
return;
|
|
4452
4473
|
}
|
|
4453
4474
|
|
|
@@ -4455,7 +4476,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
4455
4476
|
let l;
|
|
4456
4477
|
|
|
4457
4478
|
// Force an array if not already something iterable
|
|
4458
|
-
if (typeof obj !==
|
|
4479
|
+
if (typeof obj !== "object") {
|
|
4459
4480
|
/*eslint no-param-reassign:0*/
|
|
4460
4481
|
obj = [obj];
|
|
4461
4482
|
}
|
|
@@ -4472,7 +4493,9 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
4472
4493
|
}
|
|
4473
4494
|
|
|
4474
4495
|
// Iterate over object keys
|
|
4475
|
-
const keys = allOwnKeys
|
|
4496
|
+
const keys = allOwnKeys
|
|
4497
|
+
? Object.getOwnPropertyNames(obj)
|
|
4498
|
+
: Object.keys(obj);
|
|
4476
4499
|
const len = keys.length;
|
|
4477
4500
|
let key;
|
|
4478
4501
|
|
|
@@ -4484,7 +4507,7 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
4484
4507
|
}
|
|
4485
4508
|
|
|
4486
4509
|
function findKey(obj, key) {
|
|
4487
|
-
if (isBuffer(obj)){
|
|
4510
|
+
if (isBuffer(obj)) {
|
|
4488
4511
|
return null;
|
|
4489
4512
|
}
|
|
4490
4513
|
|
|
@@ -4504,10 +4527,15 @@ function findKey(obj, key) {
|
|
|
4504
4527
|
const _global = (() => {
|
|
4505
4528
|
/*eslint no-undef:0*/
|
|
4506
4529
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
4507
|
-
return typeof self !== "undefined"
|
|
4530
|
+
return typeof self !== "undefined"
|
|
4531
|
+
? self
|
|
4532
|
+
: typeof window !== "undefined"
|
|
4533
|
+
? window
|
|
4534
|
+
: global;
|
|
4508
4535
|
})();
|
|
4509
4536
|
|
|
4510
|
-
const isContextDefined = (context) =>
|
|
4537
|
+
const isContextDefined = (context) =>
|
|
4538
|
+
!isUndefined(context) && context !== _global;
|
|
4511
4539
|
|
|
4512
4540
|
/**
|
|
4513
4541
|
* Accepts varargs expecting each argument to be an object, then
|
|
@@ -4519,7 +4547,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
4519
4547
|
* Example:
|
|
4520
4548
|
*
|
|
4521
4549
|
* ```js
|
|
4522
|
-
*
|
|
4550
|
+
* const result = merge({foo: 123}, {foo: 456});
|
|
4523
4551
|
* console.log(result.foo); // outputs 456
|
|
4524
4552
|
* ```
|
|
4525
4553
|
*
|
|
@@ -4528,10 +4556,15 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
4528
4556
|
* @returns {Object} Result of all merge properties
|
|
4529
4557
|
*/
|
|
4530
4558
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
4531
|
-
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
4559
|
+
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
4532
4560
|
const result = {};
|
|
4533
4561
|
const assignValue = (val, key) => {
|
|
4534
|
-
|
|
4562
|
+
// Skip dangerous property names to prevent prototype pollution
|
|
4563
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
4564
|
+
return;
|
|
4565
|
+
}
|
|
4566
|
+
|
|
4567
|
+
const targetKey = (caseless && findKey(result, key)) || key;
|
|
4535
4568
|
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
4536
4569
|
result[targetKey] = merge(result[targetKey], val);
|
|
4537
4570
|
} else if (isPlainObject(val)) {
|
|
@@ -4556,17 +4589,32 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
4556
4589
|
* @param {Object} b The object to copy properties from
|
|
4557
4590
|
* @param {Object} thisArg The object to bind function to
|
|
4558
4591
|
*
|
|
4559
|
-
* @param {
|
|
4592
|
+
* @param {Object} [options]
|
|
4593
|
+
* @param {Boolean} [options.allOwnKeys]
|
|
4560
4594
|
* @returns {Object} The resulting value of object a
|
|
4561
4595
|
*/
|
|
4562
|
-
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
4563
|
-
forEach(
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4596
|
+
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
4597
|
+
forEach(
|
|
4598
|
+
b,
|
|
4599
|
+
(val, key) => {
|
|
4600
|
+
if (thisArg && isFunction$1(val)) {
|
|
4601
|
+
Object.defineProperty(a, key, {
|
|
4602
|
+
value: bind(val, thisArg),
|
|
4603
|
+
writable: true,
|
|
4604
|
+
enumerable: true,
|
|
4605
|
+
configurable: true,
|
|
4606
|
+
});
|
|
4607
|
+
} else {
|
|
4608
|
+
Object.defineProperty(a, key, {
|
|
4609
|
+
value: val,
|
|
4610
|
+
writable: true,
|
|
4611
|
+
enumerable: true,
|
|
4612
|
+
configurable: true,
|
|
4613
|
+
});
|
|
4614
|
+
}
|
|
4615
|
+
},
|
|
4616
|
+
{ allOwnKeys },
|
|
4617
|
+
);
|
|
4570
4618
|
return a;
|
|
4571
4619
|
};
|
|
4572
4620
|
|
|
@@ -4578,7 +4626,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
|
4578
4626
|
* @returns {string} content value without BOM
|
|
4579
4627
|
*/
|
|
4580
4628
|
const stripBOM = (content) => {
|
|
4581
|
-
if (content.charCodeAt(0) ===
|
|
4629
|
+
if (content.charCodeAt(0) === 0xfeff) {
|
|
4582
4630
|
content = content.slice(1);
|
|
4583
4631
|
}
|
|
4584
4632
|
return content;
|
|
@@ -4594,10 +4642,18 @@ const stripBOM = (content) => {
|
|
|
4594
4642
|
* @returns {void}
|
|
4595
4643
|
*/
|
|
4596
4644
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
4597
|
-
constructor.prototype = Object.create(
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4645
|
+
constructor.prototype = Object.create(
|
|
4646
|
+
superConstructor.prototype,
|
|
4647
|
+
descriptors,
|
|
4648
|
+
);
|
|
4649
|
+
Object.defineProperty(constructor.prototype, "constructor", {
|
|
4650
|
+
value: constructor,
|
|
4651
|
+
writable: true,
|
|
4652
|
+
enumerable: false,
|
|
4653
|
+
configurable: true,
|
|
4654
|
+
});
|
|
4655
|
+
Object.defineProperty(constructor, "super", {
|
|
4656
|
+
value: superConstructor.prototype,
|
|
4601
4657
|
});
|
|
4602
4658
|
props && Object.assign(constructor.prototype, props);
|
|
4603
4659
|
};
|
|
@@ -4626,13 +4682,20 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
|
4626
4682
|
i = props.length;
|
|
4627
4683
|
while (i-- > 0) {
|
|
4628
4684
|
prop = props[i];
|
|
4629
|
-
if (
|
|
4685
|
+
if (
|
|
4686
|
+
(!propFilter || propFilter(prop, sourceObj, destObj)) &&
|
|
4687
|
+
!merged[prop]
|
|
4688
|
+
) {
|
|
4630
4689
|
destObj[prop] = sourceObj[prop];
|
|
4631
4690
|
merged[prop] = true;
|
|
4632
4691
|
}
|
|
4633
4692
|
}
|
|
4634
4693
|
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
4635
|
-
} while (
|
|
4694
|
+
} while (
|
|
4695
|
+
sourceObj &&
|
|
4696
|
+
(!filter || filter(sourceObj, destObj)) &&
|
|
4697
|
+
sourceObj !== Object.prototype
|
|
4698
|
+
);
|
|
4636
4699
|
|
|
4637
4700
|
return destObj;
|
|
4638
4701
|
};
|
|
@@ -4656,7 +4719,6 @@ const endsWith = (str, searchString, position) => {
|
|
|
4656
4719
|
return lastIndex !== -1 && lastIndex === position;
|
|
4657
4720
|
};
|
|
4658
4721
|
|
|
4659
|
-
|
|
4660
4722
|
/**
|
|
4661
4723
|
* Returns new array from array like object or null if failed
|
|
4662
4724
|
*
|
|
@@ -4685,12 +4747,12 @@ const toArray = (thing) => {
|
|
|
4685
4747
|
* @returns {Array}
|
|
4686
4748
|
*/
|
|
4687
4749
|
// eslint-disable-next-line func-names
|
|
4688
|
-
const isTypedArray = (TypedArray => {
|
|
4750
|
+
const isTypedArray = ((TypedArray) => {
|
|
4689
4751
|
// eslint-disable-next-line func-names
|
|
4690
|
-
return thing => {
|
|
4752
|
+
return (thing) => {
|
|
4691
4753
|
return TypedArray && thing instanceof TypedArray;
|
|
4692
4754
|
};
|
|
4693
|
-
})(typeof Uint8Array !==
|
|
4755
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
4694
4756
|
|
|
4695
4757
|
/**
|
|
4696
4758
|
* For each entry in the object, call the function with the key and value.
|
|
@@ -4733,18 +4795,22 @@ const matchAll = (regExp, str) => {
|
|
|
4733
4795
|
};
|
|
4734
4796
|
|
|
4735
4797
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
4736
|
-
const isHTMLForm = kindOfTest(
|
|
4798
|
+
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
4737
4799
|
|
|
4738
|
-
const toCamelCase = str => {
|
|
4739
|
-
return str
|
|
4740
|
-
|
|
4800
|
+
const toCamelCase = (str) => {
|
|
4801
|
+
return str
|
|
4802
|
+
.toLowerCase()
|
|
4803
|
+
.replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
4741
4804
|
return p1.toUpperCase() + p2;
|
|
4742
|
-
}
|
|
4743
|
-
);
|
|
4805
|
+
});
|
|
4744
4806
|
};
|
|
4745
4807
|
|
|
4746
4808
|
/* Creating a function that will check if an object has a property. */
|
|
4747
|
-
const hasOwnProperty = (
|
|
4809
|
+
const hasOwnProperty = (
|
|
4810
|
+
({ hasOwnProperty }) =>
|
|
4811
|
+
(obj, prop) =>
|
|
4812
|
+
hasOwnProperty.call(obj, prop)
|
|
4813
|
+
)(Object.prototype);
|
|
4748
4814
|
|
|
4749
4815
|
/**
|
|
4750
4816
|
* Determine if a value is a RegExp object
|
|
@@ -4753,7 +4819,7 @@ const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call
|
|
|
4753
4819
|
*
|
|
4754
4820
|
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
4755
4821
|
*/
|
|
4756
|
-
const isRegExp = kindOfTest(
|
|
4822
|
+
const isRegExp = kindOfTest("RegExp");
|
|
4757
4823
|
|
|
4758
4824
|
const reduceDescriptors = (obj, reducer) => {
|
|
4759
4825
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -4777,7 +4843,10 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
4777
4843
|
const freezeMethods = (obj) => {
|
|
4778
4844
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
4779
4845
|
// skip restricted props in strict mode
|
|
4780
|
-
if (
|
|
4846
|
+
if (
|
|
4847
|
+
isFunction$1(obj) &&
|
|
4848
|
+
["arguments", "caller", "callee"].indexOf(name) !== -1
|
|
4849
|
+
) {
|
|
4781
4850
|
return false;
|
|
4782
4851
|
}
|
|
4783
4852
|
|
|
@@ -4787,14 +4856,14 @@ const freezeMethods = (obj) => {
|
|
|
4787
4856
|
|
|
4788
4857
|
descriptor.enumerable = false;
|
|
4789
4858
|
|
|
4790
|
-
if (
|
|
4859
|
+
if ("writable" in descriptor) {
|
|
4791
4860
|
descriptor.writable = false;
|
|
4792
4861
|
return;
|
|
4793
4862
|
}
|
|
4794
4863
|
|
|
4795
4864
|
if (!descriptor.set) {
|
|
4796
4865
|
descriptor.set = () => {
|
|
4797
|
-
throw Error(
|
|
4866
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
4798
4867
|
};
|
|
4799
4868
|
}
|
|
4800
4869
|
});
|
|
@@ -4804,12 +4873,14 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
4804
4873
|
const obj = {};
|
|
4805
4874
|
|
|
4806
4875
|
const define = (arr) => {
|
|
4807
|
-
arr.forEach(value => {
|
|
4876
|
+
arr.forEach((value) => {
|
|
4808
4877
|
obj[value] = true;
|
|
4809
4878
|
});
|
|
4810
4879
|
};
|
|
4811
4880
|
|
|
4812
|
-
isArray(arrayOrString)
|
|
4881
|
+
isArray(arrayOrString)
|
|
4882
|
+
? define(arrayOrString)
|
|
4883
|
+
: define(String(arrayOrString).split(delimiter));
|
|
4813
4884
|
|
|
4814
4885
|
return obj;
|
|
4815
4886
|
};
|
|
@@ -4817,11 +4888,11 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
4817
4888
|
const noop = () => {};
|
|
4818
4889
|
|
|
4819
4890
|
const toFiniteNumber = (value, defaultValue) => {
|
|
4820
|
-
return value != null && Number.isFinite(value = +value)
|
|
4891
|
+
return value != null && Number.isFinite((value = +value))
|
|
4892
|
+
? value
|
|
4893
|
+
: defaultValue;
|
|
4821
4894
|
};
|
|
4822
4895
|
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
4896
|
/**
|
|
4826
4897
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
4827
4898
|
*
|
|
@@ -4830,14 +4901,18 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
4830
4901
|
* @returns {boolean}
|
|
4831
4902
|
*/
|
|
4832
4903
|
function isSpecCompliantForm(thing) {
|
|
4833
|
-
return !!(
|
|
4904
|
+
return !!(
|
|
4905
|
+
thing &&
|
|
4906
|
+
isFunction$1(thing.append) &&
|
|
4907
|
+
thing[toStringTag] === "FormData" &&
|
|
4908
|
+
thing[iterator]
|
|
4909
|
+
);
|
|
4834
4910
|
}
|
|
4835
4911
|
|
|
4836
4912
|
const toJSONObject = (obj) => {
|
|
4837
4913
|
const stack = new Array(10);
|
|
4838
4914
|
|
|
4839
4915
|
const visit = (source, i) => {
|
|
4840
|
-
|
|
4841
4916
|
if (isObject(source)) {
|
|
4842
4917
|
if (stack.indexOf(source) >= 0) {
|
|
4843
4918
|
return;
|
|
@@ -4848,7 +4923,7 @@ const toJSONObject = (obj) => {
|
|
|
4848
4923
|
return source;
|
|
4849
4924
|
}
|
|
4850
4925
|
|
|
4851
|
-
if(!(
|
|
4926
|
+
if (!("toJSON" in source)) {
|
|
4852
4927
|
stack[i] = source;
|
|
4853
4928
|
const target = isArray(source) ? [] : {};
|
|
4854
4929
|
|
|
@@ -4869,10 +4944,13 @@ const toJSONObject = (obj) => {
|
|
|
4869
4944
|
return visit(obj, 0);
|
|
4870
4945
|
};
|
|
4871
4946
|
|
|
4872
|
-
const isAsyncFn = kindOfTest(
|
|
4947
|
+
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
4873
4948
|
|
|
4874
4949
|
const isThenable = (thing) =>
|
|
4875
|
-
thing &&
|
|
4950
|
+
thing &&
|
|
4951
|
+
(isObject(thing) || isFunction$1(thing)) &&
|
|
4952
|
+
isFunction$1(thing.then) &&
|
|
4953
|
+
isFunction$1(thing.catch);
|
|
4876
4954
|
|
|
4877
4955
|
// original code
|
|
4878
4956
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
@@ -4882,32 +4960,35 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
4882
4960
|
return setImmediate;
|
|
4883
4961
|
}
|
|
4884
4962
|
|
|
4885
|
-
return postMessageSupported
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4963
|
+
return postMessageSupported
|
|
4964
|
+
? ((token, callbacks) => {
|
|
4965
|
+
_global.addEventListener(
|
|
4966
|
+
"message",
|
|
4967
|
+
({ source, data }) => {
|
|
4968
|
+
if (source === _global && data === token) {
|
|
4969
|
+
callbacks.length && callbacks.shift()();
|
|
4970
|
+
}
|
|
4971
|
+
},
|
|
4972
|
+
false,
|
|
4973
|
+
);
|
|
4891
4974
|
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
isFunction$1(_global.postMessage)
|
|
4900
|
-
);
|
|
4975
|
+
return (cb) => {
|
|
4976
|
+
callbacks.push(cb);
|
|
4977
|
+
_global.postMessage(token, "*");
|
|
4978
|
+
};
|
|
4979
|
+
})(`axios@${Math.random()}`, [])
|
|
4980
|
+
: (cb) => setTimeout(cb);
|
|
4981
|
+
})(typeof setImmediate === "function", isFunction$1(_global.postMessage));
|
|
4901
4982
|
|
|
4902
|
-
const asap =
|
|
4903
|
-
|
|
4983
|
+
const asap =
|
|
4984
|
+
typeof queueMicrotask !== "undefined"
|
|
4985
|
+
? queueMicrotask.bind(_global)
|
|
4986
|
+
: (typeof process !== "undefined" && process.nextTick) || _setImmediate;
|
|
4904
4987
|
|
|
4905
4988
|
// *********************
|
|
4906
4989
|
|
|
4907
|
-
|
|
4908
4990
|
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
4909
4991
|
|
|
4910
|
-
|
|
4911
4992
|
var utils$1 = {
|
|
4912
4993
|
isArray,
|
|
4913
4994
|
isArrayBuffer,
|
|
@@ -4965,113 +5046,76 @@ var utils$1 = {
|
|
|
4965
5046
|
isThenable,
|
|
4966
5047
|
setImmediate: _setImmediate,
|
|
4967
5048
|
asap,
|
|
4968
|
-
isIterable
|
|
5049
|
+
isIterable,
|
|
4969
5050
|
};
|
|
4970
5051
|
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
*
|
|
4980
|
-
* @returns {Error} The created error.
|
|
4981
|
-
*/
|
|
4982
|
-
function AxiosError$1(message, code, config, request, response) {
|
|
4983
|
-
Error.call(this);
|
|
4984
|
-
|
|
4985
|
-
if (Error.captureStackTrace) {
|
|
4986
|
-
Error.captureStackTrace(this, this.constructor);
|
|
4987
|
-
} else {
|
|
4988
|
-
this.stack = (new Error()).stack;
|
|
4989
|
-
}
|
|
4990
|
-
|
|
4991
|
-
this.message = message;
|
|
4992
|
-
this.name = 'AxiosError';
|
|
4993
|
-
code && (this.code = code);
|
|
4994
|
-
config && (this.config = config);
|
|
4995
|
-
request && (this.request = request);
|
|
4996
|
-
if (response) {
|
|
4997
|
-
this.response = response;
|
|
4998
|
-
this.status = response.status ? response.status : null;
|
|
4999
|
-
}
|
|
5000
|
-
}
|
|
5001
|
-
|
|
5002
|
-
utils$1.inherits(AxiosError$1, Error, {
|
|
5003
|
-
toJSON: function toJSON() {
|
|
5004
|
-
return {
|
|
5005
|
-
// Standard
|
|
5006
|
-
message: this.message,
|
|
5007
|
-
name: this.name,
|
|
5008
|
-
// Microsoft
|
|
5009
|
-
description: this.description,
|
|
5010
|
-
number: this.number,
|
|
5011
|
-
// Mozilla
|
|
5012
|
-
fileName: this.fileName,
|
|
5013
|
-
lineNumber: this.lineNumber,
|
|
5014
|
-
columnNumber: this.columnNumber,
|
|
5015
|
-
stack: this.stack,
|
|
5016
|
-
// Axios
|
|
5017
|
-
config: utils$1.toJSONObject(this.config),
|
|
5018
|
-
code: this.code,
|
|
5019
|
-
status: this.status
|
|
5020
|
-
};
|
|
5021
|
-
}
|
|
5022
|
-
});
|
|
5023
|
-
|
|
5024
|
-
const prototype$1 = AxiosError$1.prototype;
|
|
5025
|
-
const descriptors = {};
|
|
5026
|
-
|
|
5027
|
-
[
|
|
5028
|
-
'ERR_BAD_OPTION_VALUE',
|
|
5029
|
-
'ERR_BAD_OPTION',
|
|
5030
|
-
'ECONNABORTED',
|
|
5031
|
-
'ETIMEDOUT',
|
|
5032
|
-
'ERR_NETWORK',
|
|
5033
|
-
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
5034
|
-
'ERR_DEPRECATED',
|
|
5035
|
-
'ERR_BAD_RESPONSE',
|
|
5036
|
-
'ERR_BAD_REQUEST',
|
|
5037
|
-
'ERR_CANCELED',
|
|
5038
|
-
'ERR_NOT_SUPPORT',
|
|
5039
|
-
'ERR_INVALID_URL'
|
|
5040
|
-
// eslint-disable-next-line func-names
|
|
5041
|
-
].forEach(code => {
|
|
5042
|
-
descriptors[code] = {value: code};
|
|
5043
|
-
});
|
|
5044
|
-
|
|
5045
|
-
Object.defineProperties(AxiosError$1, descriptors);
|
|
5046
|
-
Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
5047
|
-
|
|
5048
|
-
// eslint-disable-next-line func-names
|
|
5049
|
-
AxiosError$1.from = (error, code, config, request, response, customProps) => {
|
|
5050
|
-
const axiosError = Object.create(prototype$1);
|
|
5051
|
-
|
|
5052
|
-
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
|
5053
|
-
return obj !== Error.prototype;
|
|
5054
|
-
}, prop => {
|
|
5055
|
-
return prop !== 'isAxiosError';
|
|
5056
|
-
});
|
|
5057
|
-
|
|
5058
|
-
const msg = error && error.message ? error.message : 'Error';
|
|
5059
|
-
|
|
5060
|
-
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
5061
|
-
const errCode = code == null && error ? error.code : code;
|
|
5062
|
-
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
|
5063
|
-
|
|
5064
|
-
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
5065
|
-
if (error && axiosError.cause == null) {
|
|
5066
|
-
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
5067
|
-
}
|
|
5068
|
-
|
|
5069
|
-
axiosError.name = (error && error.name) || 'Error';
|
|
5070
|
-
|
|
5071
|
-
customProps && Object.assign(axiosError, customProps);
|
|
5052
|
+
let AxiosError$1 = class AxiosError extends Error {
|
|
5053
|
+
static from(error, code, config, request, response, customProps) {
|
|
5054
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
5055
|
+
axiosError.cause = error;
|
|
5056
|
+
axiosError.name = error.name;
|
|
5057
|
+
customProps && Object.assign(axiosError, customProps);
|
|
5058
|
+
return axiosError;
|
|
5059
|
+
}
|
|
5072
5060
|
|
|
5073
|
-
|
|
5074
|
-
|
|
5061
|
+
/**
|
|
5062
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
5063
|
+
*
|
|
5064
|
+
* @param {string} message The error message.
|
|
5065
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
5066
|
+
* @param {Object} [config] The config.
|
|
5067
|
+
* @param {Object} [request] The request.
|
|
5068
|
+
* @param {Object} [response] The response.
|
|
5069
|
+
*
|
|
5070
|
+
* @returns {Error} The created error.
|
|
5071
|
+
*/
|
|
5072
|
+
constructor(message, code, config, request, response) {
|
|
5073
|
+
super(message);
|
|
5074
|
+
this.name = 'AxiosError';
|
|
5075
|
+
this.isAxiosError = true;
|
|
5076
|
+
code && (this.code = code);
|
|
5077
|
+
config && (this.config = config);
|
|
5078
|
+
request && (this.request = request);
|
|
5079
|
+
if (response) {
|
|
5080
|
+
this.response = response;
|
|
5081
|
+
this.status = response.status;
|
|
5082
|
+
}
|
|
5083
|
+
}
|
|
5084
|
+
|
|
5085
|
+
toJSON() {
|
|
5086
|
+
return {
|
|
5087
|
+
// Standard
|
|
5088
|
+
message: this.message,
|
|
5089
|
+
name: this.name,
|
|
5090
|
+
// Microsoft
|
|
5091
|
+
description: this.description,
|
|
5092
|
+
number: this.number,
|
|
5093
|
+
// Mozilla
|
|
5094
|
+
fileName: this.fileName,
|
|
5095
|
+
lineNumber: this.lineNumber,
|
|
5096
|
+
columnNumber: this.columnNumber,
|
|
5097
|
+
stack: this.stack,
|
|
5098
|
+
// Axios
|
|
5099
|
+
config: utils$1.toJSONObject(this.config),
|
|
5100
|
+
code: this.code,
|
|
5101
|
+
status: this.status,
|
|
5102
|
+
};
|
|
5103
|
+
}
|
|
5104
|
+
};
|
|
5105
|
+
|
|
5106
|
+
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
5107
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
5108
|
+
AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
5109
|
+
AxiosError$1.ECONNABORTED = 'ECONNABORTED';
|
|
5110
|
+
AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
|
|
5111
|
+
AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
|
|
5112
|
+
AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
5113
|
+
AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
5114
|
+
AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
5115
|
+
AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
5116
|
+
AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
|
|
5117
|
+
AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
5118
|
+
AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
5075
5119
|
|
|
5076
5120
|
// eslint-disable-next-line strict
|
|
5077
5121
|
var httpAdapter = null;
|
|
@@ -5370,29 +5414,26 @@ function encode(val) {
|
|
|
5370
5414
|
* @returns {string} The formatted url
|
|
5371
5415
|
*/
|
|
5372
5416
|
function buildURL(url, params, options) {
|
|
5373
|
-
/*eslint no-param-reassign:0*/
|
|
5374
5417
|
if (!params) {
|
|
5375
5418
|
return url;
|
|
5376
5419
|
}
|
|
5377
|
-
|
|
5420
|
+
|
|
5378
5421
|
const _encode = options && options.encode || encode;
|
|
5379
5422
|
|
|
5380
|
-
|
|
5381
|
-
options
|
|
5382
|
-
|
|
5383
|
-
};
|
|
5384
|
-
}
|
|
5423
|
+
const _options = utils$1.isFunction(options) ? {
|
|
5424
|
+
serialize: options
|
|
5425
|
+
} : options;
|
|
5385
5426
|
|
|
5386
|
-
const serializeFn =
|
|
5427
|
+
const serializeFn = _options && _options.serialize;
|
|
5387
5428
|
|
|
5388
5429
|
let serializedParams;
|
|
5389
5430
|
|
|
5390
5431
|
if (serializeFn) {
|
|
5391
|
-
serializedParams = serializeFn(params,
|
|
5432
|
+
serializedParams = serializeFn(params, _options);
|
|
5392
5433
|
} else {
|
|
5393
5434
|
serializedParams = utils$1.isURLSearchParams(params) ?
|
|
5394
5435
|
params.toString() :
|
|
5395
|
-
new AxiosURLSearchParams(params,
|
|
5436
|
+
new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
5396
5437
|
}
|
|
5397
5438
|
|
|
5398
5439
|
if (serializedParams) {
|
|
@@ -5417,6 +5458,7 @@ class InterceptorManager {
|
|
|
5417
5458
|
*
|
|
5418
5459
|
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
5419
5460
|
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
5461
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
5420
5462
|
*
|
|
5421
5463
|
* @return {Number} An ID used to remove interceptor later
|
|
5422
5464
|
*/
|
|
@@ -5476,7 +5518,8 @@ class InterceptorManager {
|
|
|
5476
5518
|
var transitionalDefaults = {
|
|
5477
5519
|
silentJSONParsing: true,
|
|
5478
5520
|
forcedJSONParsing: true,
|
|
5479
|
-
clarifyTimeoutError: false
|
|
5521
|
+
clarifyTimeoutError: false,
|
|
5522
|
+
legacyInterceptorReqResOrdering: true
|
|
5480
5523
|
};
|
|
5481
5524
|
|
|
5482
5525
|
var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
@@ -6194,24 +6237,22 @@ function isCancel$1(value) {
|
|
|
6194
6237
|
return !!(value && value.__CANCEL__);
|
|
6195
6238
|
}
|
|
6196
6239
|
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
__CANCEL__: true
|
|
6214
|
-
});
|
|
6240
|
+
let CanceledError$1 = class CanceledError extends AxiosError$1 {
|
|
6241
|
+
/**
|
|
6242
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
6243
|
+
*
|
|
6244
|
+
* @param {string=} message The message.
|
|
6245
|
+
* @param {Object=} config The config.
|
|
6246
|
+
* @param {Object=} request The request.
|
|
6247
|
+
*
|
|
6248
|
+
* @returns {CanceledError} The created error.
|
|
6249
|
+
*/
|
|
6250
|
+
constructor(message, config, request) {
|
|
6251
|
+
super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
|
|
6252
|
+
this.name = 'CanceledError';
|
|
6253
|
+
this.__CANCEL__ = true;
|
|
6254
|
+
}
|
|
6255
|
+
};
|
|
6215
6256
|
|
|
6216
6257
|
/**
|
|
6217
6258
|
* Resolve or reject a Promise based on response status.
|
|
@@ -6452,6 +6493,10 @@ function isAbsoluteURL(url) {
|
|
|
6452
6493
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
6453
6494
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
6454
6495
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
6496
|
+
if (typeof url !== 'string') {
|
|
6497
|
+
return false;
|
|
6498
|
+
}
|
|
6499
|
+
|
|
6455
6500
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
6456
6501
|
}
|
|
6457
6502
|
|
|
@@ -6487,7 +6532,8 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
|
6487
6532
|
return requestedURL;
|
|
6488
6533
|
}
|
|
6489
6534
|
|
|
6490
|
-
const headersToObject = (thing) =>
|
|
6535
|
+
const headersToObject = (thing) =>
|
|
6536
|
+
thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
6491
6537
|
|
|
6492
6538
|
/**
|
|
6493
6539
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -6505,7 +6551,7 @@ function mergeConfig$1(config1, config2) {
|
|
|
6505
6551
|
|
|
6506
6552
|
function getMergedValue(target, source, prop, caseless) {
|
|
6507
6553
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
6508
|
-
return utils$1.merge.call({caseless}, target, source);
|
|
6554
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
6509
6555
|
} else if (utils$1.isPlainObject(source)) {
|
|
6510
6556
|
return utils$1.merge({}, source);
|
|
6511
6557
|
} else if (utils$1.isArray(source)) {
|
|
@@ -6514,7 +6560,6 @@ function mergeConfig$1(config1, config2) {
|
|
|
6514
6560
|
return source;
|
|
6515
6561
|
}
|
|
6516
6562
|
|
|
6517
|
-
// eslint-disable-next-line consistent-return
|
|
6518
6563
|
function mergeDeepProperties(a, b, prop, caseless) {
|
|
6519
6564
|
if (!utils$1.isUndefined(b)) {
|
|
6520
6565
|
return getMergedValue(a, b, prop, caseless);
|
|
@@ -6577,14 +6622,27 @@ function mergeConfig$1(config1, config2) {
|
|
|
6577
6622
|
socketPath: defaultToConfig2,
|
|
6578
6623
|
responseEncoding: defaultToConfig2,
|
|
6579
6624
|
validateStatus: mergeDirectKeys,
|
|
6580
|
-
headers: (a, b, prop) =>
|
|
6625
|
+
headers: (a, b, prop) =>
|
|
6626
|
+
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
6581
6627
|
};
|
|
6582
6628
|
|
|
6583
|
-
utils$1.forEach(
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6629
|
+
utils$1.forEach(
|
|
6630
|
+
Object.keys({ ...config1, ...config2 }),
|
|
6631
|
+
function computeConfigValue(prop) {
|
|
6632
|
+
if (
|
|
6633
|
+
prop === "__proto__" ||
|
|
6634
|
+
prop === "constructor" ||
|
|
6635
|
+
prop === "prototype"
|
|
6636
|
+
)
|
|
6637
|
+
return;
|
|
6638
|
+
const merge = utils$1.hasOwnProp(mergeMap, prop)
|
|
6639
|
+
? mergeMap[prop]
|
|
6640
|
+
: mergeDeepProperties;
|
|
6641
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
6642
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
|
|
6643
|
+
(config[prop] = configValue);
|
|
6644
|
+
},
|
|
6645
|
+
);
|
|
6588
6646
|
|
|
6589
6647
|
return config;
|
|
6590
6648
|
}
|
|
@@ -6850,7 +6908,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
6850
6908
|
|
|
6851
6909
|
let timer = timeout && setTimeout(() => {
|
|
6852
6910
|
timer = null;
|
|
6853
|
-
onabort(new AxiosError$1(`timeout ${timeout}
|
|
6911
|
+
onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
6854
6912
|
}, timeout);
|
|
6855
6913
|
|
|
6856
6914
|
const unsubscribe = () => {
|
|
@@ -7200,14 +7258,14 @@ const factory = (env) => {
|
|
|
7200
7258
|
|
|
7201
7259
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
7202
7260
|
throw Object.assign(
|
|
7203
|
-
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
|
|
7261
|
+
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response),
|
|
7204
7262
|
{
|
|
7205
7263
|
cause: err.cause || err
|
|
7206
7264
|
}
|
|
7207
7265
|
)
|
|
7208
7266
|
}
|
|
7209
7267
|
|
|
7210
|
-
throw AxiosError$1.from(err, err && err.code, config, request);
|
|
7268
|
+
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
7211
7269
|
}
|
|
7212
7270
|
}
|
|
7213
7271
|
};
|
|
@@ -7432,7 +7490,7 @@ function dispatchRequest(config) {
|
|
|
7432
7490
|
});
|
|
7433
7491
|
}
|
|
7434
7492
|
|
|
7435
|
-
const VERSION$1 = "1.13.
|
|
7493
|
+
const VERSION$1 = "1.13.5";
|
|
7436
7494
|
|
|
7437
7495
|
const validators$1 = {};
|
|
7438
7496
|
|
|
@@ -7600,7 +7658,8 @@ let Axios$1 = class Axios {
|
|
|
7600
7658
|
validator.assertOptions(transitional, {
|
|
7601
7659
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
7602
7660
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
7603
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
7661
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
7662
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
7604
7663
|
}, false);
|
|
7605
7664
|
}
|
|
7606
7665
|
|
|
@@ -7657,7 +7716,14 @@ let Axios$1 = class Axios {
|
|
|
7657
7716
|
|
|
7658
7717
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
7659
7718
|
|
|
7660
|
-
|
|
7719
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
7720
|
+
const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
|
|
7721
|
+
|
|
7722
|
+
if (legacyInterceptorReqResOrdering) {
|
|
7723
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
7724
|
+
} else {
|
|
7725
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
7726
|
+
}
|
|
7661
7727
|
});
|
|
7662
7728
|
|
|
7663
7729
|
const responseInterceptorChain = [];
|
|
@@ -7892,7 +7958,7 @@ let CancelToken$1 = class CancelToken {
|
|
|
7892
7958
|
*
|
|
7893
7959
|
* ```js
|
|
7894
7960
|
* function f(x, y, z) {}
|
|
7895
|
-
*
|
|
7961
|
+
* const args = [1, 2, 3];
|
|
7896
7962
|
* f.apply(null, args);
|
|
7897
7963
|
* ```
|
|
7898
7964
|
*
|