@pactflow/openapi-pact-comparator 1.11.0 → 1.12.0
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/cli.cjs +283 -113
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +214 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +214 -85
- package/dist/index.mjs.map +1 -1
- package/dist/server.cjs +71337 -0
- package/dist/server.cjs.map +1 -0
- package/dist/src/cli/runner.d.ts +22 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/server.d.ts +1 -0
- package/dist/src/transform/requestSchema.d.ts +2 -0
- package/package.json +16 -14
package/dist/index.cjs
CHANGED
|
@@ -17,17 +17,17 @@ var root = freeGlobal || freeSelf || Function('return this')();
|
|
|
17
17
|
var Symbol$2 = root.Symbol;
|
|
18
18
|
|
|
19
19
|
/** Used for built-in method references. */
|
|
20
|
-
var objectProto$
|
|
20
|
+
var objectProto$e = Object.prototype;
|
|
21
21
|
|
|
22
22
|
/** Used to check objects for own properties. */
|
|
23
|
-
var hasOwnProperty$
|
|
23
|
+
var hasOwnProperty$b = objectProto$e.hasOwnProperty;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Used to resolve the
|
|
27
27
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
28
28
|
* of values.
|
|
29
29
|
*/
|
|
30
|
-
var nativeObjectToString$1 = objectProto$
|
|
30
|
+
var nativeObjectToString$1 = objectProto$e.toString;
|
|
31
31
|
|
|
32
32
|
/** Built-in value references. */
|
|
33
33
|
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
@@ -40,7 +40,7 @@ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
|
40
40
|
* @returns {string} Returns the raw `toStringTag`.
|
|
41
41
|
*/
|
|
42
42
|
function getRawTag(value) {
|
|
43
|
-
var isOwn = hasOwnProperty$
|
|
43
|
+
var isOwn = hasOwnProperty$b.call(value, symToStringTag$1),
|
|
44
44
|
tag = value[symToStringTag$1];
|
|
45
45
|
|
|
46
46
|
try {
|
|
@@ -60,14 +60,14 @@ function getRawTag(value) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/** Used for built-in method references. */
|
|
63
|
-
var objectProto$
|
|
63
|
+
var objectProto$d = Object.prototype;
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* Used to resolve the
|
|
67
67
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
68
68
|
* of values.
|
|
69
69
|
*/
|
|
70
|
-
var nativeObjectToString = objectProto$
|
|
70
|
+
var nativeObjectToString = objectProto$d.toString;
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Converts `value` to a string using `Object.prototype.toString`.
|
|
@@ -368,17 +368,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
|
368
368
|
|
|
369
369
|
/** Used for built-in method references. */
|
|
370
370
|
var funcProto$1 = Function.prototype,
|
|
371
|
-
objectProto$
|
|
371
|
+
objectProto$c = Object.prototype;
|
|
372
372
|
|
|
373
373
|
/** Used to resolve the decompiled source of functions. */
|
|
374
374
|
var funcToString$1 = funcProto$1.toString;
|
|
375
375
|
|
|
376
376
|
/** Used to check objects for own properties. */
|
|
377
|
-
var hasOwnProperty$
|
|
377
|
+
var hasOwnProperty$a = objectProto$c.hasOwnProperty;
|
|
378
378
|
|
|
379
379
|
/** Used to detect if a method is native. */
|
|
380
380
|
var reIsNative = RegExp('^' +
|
|
381
|
-
funcToString$1.call(hasOwnProperty$
|
|
381
|
+
funcToString$1.call(hasOwnProperty$a).replace(reRegExpChar, '\\$&')
|
|
382
382
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
383
383
|
);
|
|
384
384
|
|
|
@@ -793,10 +793,10 @@ function eq(value, other) {
|
|
|
793
793
|
}
|
|
794
794
|
|
|
795
795
|
/** Used for built-in method references. */
|
|
796
|
-
var objectProto$
|
|
796
|
+
var objectProto$b = Object.prototype;
|
|
797
797
|
|
|
798
798
|
/** Used to check objects for own properties. */
|
|
799
|
-
var hasOwnProperty$
|
|
799
|
+
var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
800
800
|
|
|
801
801
|
/**
|
|
802
802
|
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
@@ -810,7 +810,7 @@ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
|
810
810
|
*/
|
|
811
811
|
function assignValue(object, key, value) {
|
|
812
812
|
var objValue = object[key];
|
|
813
|
-
if (!(hasOwnProperty$
|
|
813
|
+
if (!(hasOwnProperty$9.call(object, key) && eq(objValue, value)) ||
|
|
814
814
|
(value === undefined && !(key in object))) {
|
|
815
815
|
baseAssignValue(object, key, value);
|
|
816
816
|
}
|
|
@@ -1016,7 +1016,7 @@ function createAssigner(assigner) {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
|
|
1018
1018
|
/** Used for built-in method references. */
|
|
1019
|
-
var objectProto$
|
|
1019
|
+
var objectProto$a = Object.prototype;
|
|
1020
1020
|
|
|
1021
1021
|
/**
|
|
1022
1022
|
* Checks if `value` is likely a prototype object.
|
|
@@ -1027,7 +1027,7 @@ var objectProto$9 = Object.prototype;
|
|
|
1027
1027
|
*/
|
|
1028
1028
|
function isPrototype(value) {
|
|
1029
1029
|
var Ctor = value && value.constructor,
|
|
1030
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$
|
|
1030
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$a;
|
|
1031
1031
|
|
|
1032
1032
|
return value === proto;
|
|
1033
1033
|
}
|
|
@@ -1066,13 +1066,13 @@ function baseIsArguments(value) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
|
|
1068
1068
|
/** Used for built-in method references. */
|
|
1069
|
-
var objectProto$
|
|
1069
|
+
var objectProto$9 = Object.prototype;
|
|
1070
1070
|
|
|
1071
1071
|
/** Used to check objects for own properties. */
|
|
1072
|
-
var hasOwnProperty$
|
|
1072
|
+
var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
1073
1073
|
|
|
1074
1074
|
/** Built-in value references. */
|
|
1075
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
1075
|
+
var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
|
|
1076
1076
|
|
|
1077
1077
|
/**
|
|
1078
1078
|
* Checks if `value` is likely an `arguments` object.
|
|
@@ -1093,7 +1093,7 @@ var propertyIsEnumerable$1 = objectProto$8.propertyIsEnumerable;
|
|
|
1093
1093
|
* // => false
|
|
1094
1094
|
*/
|
|
1095
1095
|
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
1096
|
-
return isObjectLike(value) && hasOwnProperty$
|
|
1096
|
+
return isObjectLike(value) && hasOwnProperty$8.call(value, 'callee') &&
|
|
1097
1097
|
!propertyIsEnumerable$1.call(value, 'callee');
|
|
1098
1098
|
};
|
|
1099
1099
|
|
|
@@ -1266,10 +1266,10 @@ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
|
1266
1266
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1267
1267
|
|
|
1268
1268
|
/** Used for built-in method references. */
|
|
1269
|
-
var objectProto$
|
|
1269
|
+
var objectProto$8 = Object.prototype;
|
|
1270
1270
|
|
|
1271
1271
|
/** Used to check objects for own properties. */
|
|
1272
|
-
var hasOwnProperty$
|
|
1272
|
+
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
1273
1273
|
|
|
1274
1274
|
/**
|
|
1275
1275
|
* Creates an array of the enumerable property names of the array-like `value`.
|
|
@@ -1289,7 +1289,7 @@ function arrayLikeKeys(value, inherited) {
|
|
|
1289
1289
|
length = result.length;
|
|
1290
1290
|
|
|
1291
1291
|
for (var key in value) {
|
|
1292
|
-
if ((inherited || hasOwnProperty$
|
|
1292
|
+
if ((inherited || hasOwnProperty$7.call(value, key)) &&
|
|
1293
1293
|
!(skipIndexes && (
|
|
1294
1294
|
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1295
1295
|
key == 'length' ||
|
|
@@ -1324,10 +1324,10 @@ function overArg(func, transform) {
|
|
|
1324
1324
|
var nativeKeys = overArg(Object.keys, Object);
|
|
1325
1325
|
|
|
1326
1326
|
/** Used for built-in method references. */
|
|
1327
|
-
var objectProto$
|
|
1327
|
+
var objectProto$7 = Object.prototype;
|
|
1328
1328
|
|
|
1329
1329
|
/** Used to check objects for own properties. */
|
|
1330
|
-
var hasOwnProperty$
|
|
1330
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
1331
1331
|
|
|
1332
1332
|
/**
|
|
1333
1333
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
@@ -1342,7 +1342,7 @@ function baseKeys(object) {
|
|
|
1342
1342
|
}
|
|
1343
1343
|
var result = [];
|
|
1344
1344
|
for (var key in Object(object)) {
|
|
1345
|
-
if (hasOwnProperty$
|
|
1345
|
+
if (hasOwnProperty$6.call(object, key) && key != 'constructor') {
|
|
1346
1346
|
result.push(key);
|
|
1347
1347
|
}
|
|
1348
1348
|
}
|
|
@@ -1401,10 +1401,10 @@ function nativeKeysIn(object) {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
|
|
1403
1403
|
/** Used for built-in method references. */
|
|
1404
|
-
var objectProto$
|
|
1404
|
+
var objectProto$6 = Object.prototype;
|
|
1405
1405
|
|
|
1406
1406
|
/** Used to check objects for own properties. */
|
|
1407
|
-
var hasOwnProperty$
|
|
1407
|
+
var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
1408
1408
|
|
|
1409
1409
|
/**
|
|
1410
1410
|
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
|
@@ -1421,7 +1421,7 @@ function baseKeysIn(object) {
|
|
|
1421
1421
|
result = [];
|
|
1422
1422
|
|
|
1423
1423
|
for (var key in object) {
|
|
1424
|
-
if (!(key == 'constructor' && (isProto || !hasOwnProperty$
|
|
1424
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty$5.call(object, key)))) {
|
|
1425
1425
|
result.push(key);
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
@@ -1515,10 +1515,10 @@ function hashDelete(key) {
|
|
|
1515
1515
|
var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
|
1516
1516
|
|
|
1517
1517
|
/** Used for built-in method references. */
|
|
1518
|
-
var objectProto$
|
|
1518
|
+
var objectProto$5 = Object.prototype;
|
|
1519
1519
|
|
|
1520
1520
|
/** Used to check objects for own properties. */
|
|
1521
|
-
var hasOwnProperty$
|
|
1521
|
+
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
1522
1522
|
|
|
1523
1523
|
/**
|
|
1524
1524
|
* Gets the hash value for `key`.
|
|
@@ -1535,14 +1535,14 @@ function hashGet(key) {
|
|
|
1535
1535
|
var result = data[key];
|
|
1536
1536
|
return result === HASH_UNDEFINED$2 ? undefined : result;
|
|
1537
1537
|
}
|
|
1538
|
-
return hasOwnProperty$
|
|
1538
|
+
return hasOwnProperty$4.call(data, key) ? data[key] : undefined;
|
|
1539
1539
|
}
|
|
1540
1540
|
|
|
1541
1541
|
/** Used for built-in method references. */
|
|
1542
|
-
var objectProto$
|
|
1542
|
+
var objectProto$4 = Object.prototype;
|
|
1543
1543
|
|
|
1544
1544
|
/** Used to check objects for own properties. */
|
|
1545
|
-
var hasOwnProperty$
|
|
1545
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
1546
1546
|
|
|
1547
1547
|
/**
|
|
1548
1548
|
* Checks if a hash value for `key` exists.
|
|
@@ -1555,7 +1555,7 @@ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
|
1555
1555
|
*/
|
|
1556
1556
|
function hashHas(key) {
|
|
1557
1557
|
var data = this.__data__;
|
|
1558
|
-
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$
|
|
1558
|
+
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$3.call(data, key);
|
|
1559
1559
|
}
|
|
1560
1560
|
|
|
1561
1561
|
/** Used to stand-in for `undefined` hash values. */
|
|
@@ -2200,13 +2200,13 @@ var objectTag$2 = '[object Object]';
|
|
|
2200
2200
|
|
|
2201
2201
|
/** Used for built-in method references. */
|
|
2202
2202
|
var funcProto = Function.prototype,
|
|
2203
|
-
objectProto$
|
|
2203
|
+
objectProto$3 = Object.prototype;
|
|
2204
2204
|
|
|
2205
2205
|
/** Used to resolve the decompiled source of functions. */
|
|
2206
2206
|
var funcToString = funcProto.toString;
|
|
2207
2207
|
|
|
2208
2208
|
/** Used to check objects for own properties. */
|
|
2209
|
-
var hasOwnProperty$
|
|
2209
|
+
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
2210
2210
|
|
|
2211
2211
|
/** Used to infer the `Object` constructor. */
|
|
2212
2212
|
var objectCtorString = funcToString.call(Object);
|
|
@@ -2247,7 +2247,7 @@ function isPlainObject(value) {
|
|
|
2247
2247
|
if (proto === null) {
|
|
2248
2248
|
return true;
|
|
2249
2249
|
}
|
|
2250
|
-
var Ctor = hasOwnProperty$
|
|
2250
|
+
var Ctor = hasOwnProperty$2.call(proto, 'constructor') && proto.constructor;
|
|
2251
2251
|
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
2252
2252
|
funcToString.call(Ctor) == objectCtorString;
|
|
2253
2253
|
}
|
|
@@ -2490,10 +2490,10 @@ function stubArray() {
|
|
|
2490
2490
|
}
|
|
2491
2491
|
|
|
2492
2492
|
/** Used for built-in method references. */
|
|
2493
|
-
var objectProto$
|
|
2493
|
+
var objectProto$2 = Object.prototype;
|
|
2494
2494
|
|
|
2495
2495
|
/** Built-in value references. */
|
|
2496
|
-
var propertyIsEnumerable = objectProto$
|
|
2496
|
+
var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
|
|
2497
2497
|
|
|
2498
2498
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2499
2499
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
@@ -2656,10 +2656,10 @@ if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2)
|
|
|
2656
2656
|
}
|
|
2657
2657
|
|
|
2658
2658
|
/** Used for built-in method references. */
|
|
2659
|
-
var objectProto = Object.prototype;
|
|
2659
|
+
var objectProto$1 = Object.prototype;
|
|
2660
2660
|
|
|
2661
2661
|
/** Used to check objects for own properties. */
|
|
2662
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2662
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
2663
2663
|
|
|
2664
2664
|
/**
|
|
2665
2665
|
* Initializes an array clone.
|
|
@@ -2673,7 +2673,7 @@ function initCloneArray(array) {
|
|
|
2673
2673
|
result = new array.constructor(length);
|
|
2674
2674
|
|
|
2675
2675
|
// Add properties assigned by `RegExp#exec`.
|
|
2676
|
-
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
|
2676
|
+
if (length && typeof array[0] == 'string' && hasOwnProperty$1.call(array, 'index')) {
|
|
2677
2677
|
result.index = array.index;
|
|
2678
2678
|
result.input = array.input;
|
|
2679
2679
|
}
|
|
@@ -3582,6 +3582,12 @@ var merge = createAssigner(function(object, source, srcIndex) {
|
|
|
3582
3582
|
baseMerge(object, source, srcIndex);
|
|
3583
3583
|
});
|
|
3584
3584
|
|
|
3585
|
+
/** Used for built-in method references. */
|
|
3586
|
+
var objectProto = Object.prototype;
|
|
3587
|
+
|
|
3588
|
+
/** Used to check objects for own properties. */
|
|
3589
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
3590
|
+
|
|
3585
3591
|
/**
|
|
3586
3592
|
* The base implementation of `_.unset`.
|
|
3587
3593
|
*
|
|
@@ -3592,8 +3598,47 @@ var merge = createAssigner(function(object, source, srcIndex) {
|
|
|
3592
3598
|
*/
|
|
3593
3599
|
function baseUnset(object, path) {
|
|
3594
3600
|
path = castPath(path, object);
|
|
3595
|
-
|
|
3596
|
-
|
|
3601
|
+
|
|
3602
|
+
// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
|
3603
|
+
var index = -1,
|
|
3604
|
+
length = path.length;
|
|
3605
|
+
|
|
3606
|
+
if (!length) {
|
|
3607
|
+
return true;
|
|
3608
|
+
}
|
|
3609
|
+
|
|
3610
|
+
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
|
|
3611
|
+
|
|
3612
|
+
while (++index < length) {
|
|
3613
|
+
var key = path[index];
|
|
3614
|
+
|
|
3615
|
+
// skip non-string keys (e.g., Symbols, numbers)
|
|
3616
|
+
if (typeof key !== 'string') {
|
|
3617
|
+
continue;
|
|
3618
|
+
}
|
|
3619
|
+
|
|
3620
|
+
// Always block "__proto__" anywhere in the path if it's not expected
|
|
3621
|
+
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
|
3622
|
+
return false;
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3625
|
+
// Block "constructor.prototype" chains
|
|
3626
|
+
if (key === 'constructor' &&
|
|
3627
|
+
(index + 1) < length &&
|
|
3628
|
+
typeof path[index + 1] === 'string' &&
|
|
3629
|
+
path[index + 1] === 'prototype') {
|
|
3630
|
+
|
|
3631
|
+
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
|
|
3632
|
+
if (isRootPrimitive && index === 0) {
|
|
3633
|
+
continue;
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3636
|
+
return false;
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
var obj = parent(object, path);
|
|
3641
|
+
return obj == null || delete obj[toKey(last(path))];
|
|
3597
3642
|
}
|
|
3598
3643
|
|
|
3599
3644
|
/**
|
|
@@ -6058,10 +6103,32 @@ function requireUtils$1 () {
|
|
|
6058
6103
|
hasRequiredUtils$1 = 1;
|
|
6059
6104
|
|
|
6060
6105
|
var formats = /*@__PURE__*/ requireFormats$1();
|
|
6106
|
+
var getSideChannel = requireSideChannel();
|
|
6061
6107
|
|
|
6062
6108
|
var has = Object.prototype.hasOwnProperty;
|
|
6063
6109
|
var isArray = Array.isArray;
|
|
6064
6110
|
|
|
6111
|
+
// Track objects created from arrayLimit overflow using side-channel
|
|
6112
|
+
// Stores the current max numeric index for O(1) lookup
|
|
6113
|
+
var overflowChannel = getSideChannel();
|
|
6114
|
+
|
|
6115
|
+
var markOverflow = function markOverflow(obj, maxIndex) {
|
|
6116
|
+
overflowChannel.set(obj, maxIndex);
|
|
6117
|
+
return obj;
|
|
6118
|
+
};
|
|
6119
|
+
|
|
6120
|
+
var isOverflow = function isOverflow(obj) {
|
|
6121
|
+
return overflowChannel.has(obj);
|
|
6122
|
+
};
|
|
6123
|
+
|
|
6124
|
+
var getMaxIndex = function getMaxIndex(obj) {
|
|
6125
|
+
return overflowChannel.get(obj);
|
|
6126
|
+
};
|
|
6127
|
+
|
|
6128
|
+
var setMaxIndex = function setMaxIndex(obj, maxIndex) {
|
|
6129
|
+
overflowChannel.set(obj, maxIndex);
|
|
6130
|
+
};
|
|
6131
|
+
|
|
6065
6132
|
var hexTable = (function () {
|
|
6066
6133
|
var array = [];
|
|
6067
6134
|
for (var i = 0; i < 256; ++i) {
|
|
@@ -6111,7 +6178,12 @@ function requireUtils$1 () {
|
|
|
6111
6178
|
if (isArray(target)) {
|
|
6112
6179
|
target.push(source);
|
|
6113
6180
|
} else if (target && typeof target === 'object') {
|
|
6114
|
-
if (
|
|
6181
|
+
if (isOverflow(target)) {
|
|
6182
|
+
// Add at next numeric index for overflow objects
|
|
6183
|
+
var newIndex = getMaxIndex(target) + 1;
|
|
6184
|
+
target[newIndex] = source;
|
|
6185
|
+
setMaxIndex(target, newIndex);
|
|
6186
|
+
} else if (
|
|
6115
6187
|
(options && (options.plainObjects || options.allowPrototypes))
|
|
6116
6188
|
|| !has.call(Object.prototype, source)
|
|
6117
6189
|
) {
|
|
@@ -6125,6 +6197,18 @@ function requireUtils$1 () {
|
|
|
6125
6197
|
}
|
|
6126
6198
|
|
|
6127
6199
|
if (!target || typeof target !== 'object') {
|
|
6200
|
+
if (isOverflow(source)) {
|
|
6201
|
+
// Create new object with target at 0, source values shifted by 1
|
|
6202
|
+
var sourceKeys = Object.keys(source);
|
|
6203
|
+
var result = options && options.plainObjects
|
|
6204
|
+
? { __proto__: null, 0: target }
|
|
6205
|
+
: { 0: target };
|
|
6206
|
+
for (var m = 0; m < sourceKeys.length; m++) {
|
|
6207
|
+
var oldKey = parseInt(sourceKeys[m], 10);
|
|
6208
|
+
result[oldKey + 1] = source[sourceKeys[m]];
|
|
6209
|
+
}
|
|
6210
|
+
return markOverflow(result, getMaxIndex(source) + 1);
|
|
6211
|
+
}
|
|
6128
6212
|
return [target].concat(source);
|
|
6129
6213
|
}
|
|
6130
6214
|
|
|
@@ -6296,8 +6380,20 @@ function requireUtils$1 () {
|
|
|
6296
6380
|
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
6297
6381
|
};
|
|
6298
6382
|
|
|
6299
|
-
var combine = function combine(a, b) {
|
|
6300
|
-
|
|
6383
|
+
var combine = function combine(a, b, arrayLimit, plainObjects) {
|
|
6384
|
+
// If 'a' is already an overflow object, add to it
|
|
6385
|
+
if (isOverflow(a)) {
|
|
6386
|
+
var newIndex = getMaxIndex(a) + 1;
|
|
6387
|
+
a[newIndex] = b;
|
|
6388
|
+
setMaxIndex(a, newIndex);
|
|
6389
|
+
return a;
|
|
6390
|
+
}
|
|
6391
|
+
|
|
6392
|
+
var result = [].concat(a, b);
|
|
6393
|
+
if (result.length > arrayLimit) {
|
|
6394
|
+
return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);
|
|
6395
|
+
}
|
|
6396
|
+
return result;
|
|
6301
6397
|
};
|
|
6302
6398
|
|
|
6303
6399
|
var maybeMap = function maybeMap(val, fn) {
|
|
@@ -6319,6 +6415,7 @@ function requireUtils$1 () {
|
|
|
6319
6415
|
decode: decode,
|
|
6320
6416
|
encode: encode,
|
|
6321
6417
|
isBuffer: isBuffer,
|
|
6418
|
+
isOverflow: isOverflow,
|
|
6322
6419
|
isRegExp: isRegExp,
|
|
6323
6420
|
maybeMap: maybeMap,
|
|
6324
6421
|
merge: merge
|
|
@@ -6805,16 +6902,18 @@ function requireParse$1 () {
|
|
|
6805
6902
|
} else {
|
|
6806
6903
|
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
6807
6904
|
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6905
|
+
if (key !== null) {
|
|
6906
|
+
val = utils.maybeMap(
|
|
6907
|
+
parseArrayValue(
|
|
6908
|
+
part.slice(pos + 1),
|
|
6909
|
+
options,
|
|
6910
|
+
isArray(obj[key]) ? obj[key].length : 0
|
|
6911
|
+
),
|
|
6912
|
+
function (encodedVal) {
|
|
6913
|
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
6914
|
+
}
|
|
6915
|
+
);
|
|
6916
|
+
}
|
|
6818
6917
|
}
|
|
6819
6918
|
|
|
6820
6919
|
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
@@ -6825,11 +6924,18 @@ function requireParse$1 () {
|
|
|
6825
6924
|
val = isArray(val) ? [val] : val;
|
|
6826
6925
|
}
|
|
6827
6926
|
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6927
|
+
if (key !== null) {
|
|
6928
|
+
var existing = has.call(obj, key);
|
|
6929
|
+
if (existing && options.duplicates === 'combine') {
|
|
6930
|
+
obj[key] = utils.combine(
|
|
6931
|
+
obj[key],
|
|
6932
|
+
val,
|
|
6933
|
+
options.arrayLimit,
|
|
6934
|
+
options.plainObjects
|
|
6935
|
+
);
|
|
6936
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
6937
|
+
obj[key] = val;
|
|
6938
|
+
}
|
|
6833
6939
|
}
|
|
6834
6940
|
}
|
|
6835
6941
|
|
|
@@ -6850,9 +6956,19 @@ function requireParse$1 () {
|
|
|
6850
6956
|
var root = chain[i];
|
|
6851
6957
|
|
|
6852
6958
|
if (root === '[]' && options.parseArrays) {
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6959
|
+
if (utils.isOverflow(leaf)) {
|
|
6960
|
+
// leaf is already an overflow object, preserve it
|
|
6961
|
+
obj = leaf;
|
|
6962
|
+
} else {
|
|
6963
|
+
obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
|
|
6964
|
+
? []
|
|
6965
|
+
: utils.combine(
|
|
6966
|
+
[],
|
|
6967
|
+
leaf,
|
|
6968
|
+
options.arrayLimit,
|
|
6969
|
+
options.plainObjects
|
|
6970
|
+
);
|
|
6971
|
+
}
|
|
6856
6972
|
} else {
|
|
6857
6973
|
obj = options.plainObjects ? { __proto__: null } : {};
|
|
6858
6974
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
@@ -6880,29 +6996,28 @@ function requireParse$1 () {
|
|
|
6880
6996
|
return leaf;
|
|
6881
6997
|
};
|
|
6882
6998
|
|
|
6883
|
-
var
|
|
6884
|
-
if (!givenKey) {
|
|
6885
|
-
return;
|
|
6886
|
-
}
|
|
6887
|
-
|
|
6888
|
-
// Transform dot notation to bracket notation
|
|
6999
|
+
var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
|
|
6889
7000
|
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
6890
7001
|
|
|
6891
|
-
|
|
7002
|
+
if (options.depth <= 0) {
|
|
7003
|
+
if (!options.plainObjects && has.call(Object.prototype, key)) {
|
|
7004
|
+
if (!options.allowPrototypes) {
|
|
7005
|
+
return;
|
|
7006
|
+
}
|
|
7007
|
+
}
|
|
7008
|
+
|
|
7009
|
+
return [key];
|
|
7010
|
+
}
|
|
6892
7011
|
|
|
6893
7012
|
var brackets = /(\[[^[\]]*])/;
|
|
6894
7013
|
var child = /(\[[^[\]]*])/g;
|
|
6895
7014
|
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
var segment = options.depth > 0 && brackets.exec(key);
|
|
7015
|
+
var segment = brackets.exec(key);
|
|
6899
7016
|
var parent = segment ? key.slice(0, segment.index) : key;
|
|
6900
7017
|
|
|
6901
|
-
// Stash the parent if it exists
|
|
6902
|
-
|
|
6903
7018
|
var keys = [];
|
|
7019
|
+
|
|
6904
7020
|
if (parent) {
|
|
6905
|
-
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
6906
7021
|
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
6907
7022
|
if (!options.allowPrototypes) {
|
|
6908
7023
|
return;
|
|
@@ -6912,28 +7027,42 @@ function requireParse$1 () {
|
|
|
6912
7027
|
keys.push(parent);
|
|
6913
7028
|
}
|
|
6914
7029
|
|
|
6915
|
-
// Loop through children appending to the array until we hit depth
|
|
6916
|
-
|
|
6917
7030
|
var i = 0;
|
|
6918
|
-
while (
|
|
7031
|
+
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
6919
7032
|
i += 1;
|
|
6920
|
-
|
|
7033
|
+
|
|
7034
|
+
var segmentContent = segment[1].slice(1, -1);
|
|
7035
|
+
if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
|
|
6921
7036
|
if (!options.allowPrototypes) {
|
|
6922
7037
|
return;
|
|
6923
7038
|
}
|
|
6924
7039
|
}
|
|
7040
|
+
|
|
6925
7041
|
keys.push(segment[1]);
|
|
6926
7042
|
}
|
|
6927
7043
|
|
|
6928
|
-
// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
6929
|
-
|
|
6930
7044
|
if (segment) {
|
|
6931
7045
|
if (options.strictDepth === true) {
|
|
6932
7046
|
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
6933
7047
|
}
|
|
7048
|
+
|
|
6934
7049
|
keys.push('[' + key.slice(segment.index) + ']');
|
|
6935
7050
|
}
|
|
6936
7051
|
|
|
7052
|
+
return keys;
|
|
7053
|
+
};
|
|
7054
|
+
|
|
7055
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
7056
|
+
if (!givenKey) {
|
|
7057
|
+
return;
|
|
7058
|
+
}
|
|
7059
|
+
|
|
7060
|
+
var keys = splitKeyIntoSegments(givenKey, options);
|
|
7061
|
+
|
|
7062
|
+
if (!keys) {
|
|
7063
|
+
return;
|
|
7064
|
+
}
|
|
7065
|
+
|
|
6937
7066
|
return parseObject(keys, val, options, valuesParsed);
|
|
6938
7067
|
};
|
|
6939
7068
|
|
|
@@ -13804,13 +13933,13 @@ function requireDataType () {
|
|
|
13804
13933
|
case "number":
|
|
13805
13934
|
gen
|
|
13806
13935
|
.elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null
|
|
13807
|
-
|| (${dataType} == "string" && ${data} && ${data}
|
|
13936
|
+
|| (${dataType} == "string" && ${data} && ${data} == +${data})`)
|
|
13808
13937
|
.assign(coerced, (0, codegen_1._) `+${data}`);
|
|
13809
13938
|
return;
|
|
13810
13939
|
case "integer":
|
|
13811
13940
|
gen
|
|
13812
13941
|
.elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null
|
|
13813
|
-
|| (${dataType} === "string" && ${data} && ${data}
|
|
13942
|
+
|| (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
|
|
13814
13943
|
.assign(coerced, (0, codegen_1._) `+${data}`);
|
|
13815
13944
|
return;
|
|
13816
13945
|
case "boolean":
|