@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/cli.cjs
CHANGED
|
@@ -4321,6 +4321,10 @@ const {
|
|
|
4321
4321
|
Help,
|
|
4322
4322
|
} = commander;
|
|
4323
4323
|
|
|
4324
|
+
var version = "1.12.0";
|
|
4325
|
+
var packageJson = {
|
|
4326
|
+
version: version};
|
|
4327
|
+
|
|
4324
4328
|
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
4325
4329
|
function isNothing(subject) {
|
|
4326
4330
|
return (typeof subject === 'undefined') || (subject === null);
|
|
@@ -8188,17 +8192,17 @@ var root = freeGlobal || freeSelf || Function('return this')();
|
|
|
8188
8192
|
var Symbol$2 = root.Symbol;
|
|
8189
8193
|
|
|
8190
8194
|
/** Used for built-in method references. */
|
|
8191
|
-
var objectProto$
|
|
8195
|
+
var objectProto$e = Object.prototype;
|
|
8192
8196
|
|
|
8193
8197
|
/** Used to check objects for own properties. */
|
|
8194
|
-
var hasOwnProperty$
|
|
8198
|
+
var hasOwnProperty$b = objectProto$e.hasOwnProperty;
|
|
8195
8199
|
|
|
8196
8200
|
/**
|
|
8197
8201
|
* Used to resolve the
|
|
8198
8202
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
8199
8203
|
* of values.
|
|
8200
8204
|
*/
|
|
8201
|
-
var nativeObjectToString$1 = objectProto$
|
|
8205
|
+
var nativeObjectToString$1 = objectProto$e.toString;
|
|
8202
8206
|
|
|
8203
8207
|
/** Built-in value references. */
|
|
8204
8208
|
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
@@ -8211,7 +8215,7 @@ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
|
8211
8215
|
* @returns {string} Returns the raw `toStringTag`.
|
|
8212
8216
|
*/
|
|
8213
8217
|
function getRawTag(value) {
|
|
8214
|
-
var isOwn = hasOwnProperty$
|
|
8218
|
+
var isOwn = hasOwnProperty$b.call(value, symToStringTag$1),
|
|
8215
8219
|
tag = value[symToStringTag$1];
|
|
8216
8220
|
|
|
8217
8221
|
try {
|
|
@@ -8231,14 +8235,14 @@ function getRawTag(value) {
|
|
|
8231
8235
|
}
|
|
8232
8236
|
|
|
8233
8237
|
/** Used for built-in method references. */
|
|
8234
|
-
var objectProto$
|
|
8238
|
+
var objectProto$d = Object.prototype;
|
|
8235
8239
|
|
|
8236
8240
|
/**
|
|
8237
8241
|
* Used to resolve the
|
|
8238
8242
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
8239
8243
|
* of values.
|
|
8240
8244
|
*/
|
|
8241
|
-
var nativeObjectToString = objectProto$
|
|
8245
|
+
var nativeObjectToString = objectProto$d.toString;
|
|
8242
8246
|
|
|
8243
8247
|
/**
|
|
8244
8248
|
* Converts `value` to a string using `Object.prototype.toString`.
|
|
@@ -8539,17 +8543,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
|
8539
8543
|
|
|
8540
8544
|
/** Used for built-in method references. */
|
|
8541
8545
|
var funcProto$1 = Function.prototype,
|
|
8542
|
-
objectProto$
|
|
8546
|
+
objectProto$c = Object.prototype;
|
|
8543
8547
|
|
|
8544
8548
|
/** Used to resolve the decompiled source of functions. */
|
|
8545
8549
|
var funcToString$1 = funcProto$1.toString;
|
|
8546
8550
|
|
|
8547
8551
|
/** Used to check objects for own properties. */
|
|
8548
|
-
var hasOwnProperty$
|
|
8552
|
+
var hasOwnProperty$a = objectProto$c.hasOwnProperty;
|
|
8549
8553
|
|
|
8550
8554
|
/** Used to detect if a method is native. */
|
|
8551
8555
|
var reIsNative = RegExp('^' +
|
|
8552
|
-
funcToString$1.call(hasOwnProperty$
|
|
8556
|
+
funcToString$1.call(hasOwnProperty$a).replace(reRegExpChar, '\\$&')
|
|
8553
8557
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
8554
8558
|
);
|
|
8555
8559
|
|
|
@@ -8964,10 +8968,10 @@ function eq(value, other) {
|
|
|
8964
8968
|
}
|
|
8965
8969
|
|
|
8966
8970
|
/** Used for built-in method references. */
|
|
8967
|
-
var objectProto$
|
|
8971
|
+
var objectProto$b = Object.prototype;
|
|
8968
8972
|
|
|
8969
8973
|
/** Used to check objects for own properties. */
|
|
8970
|
-
var hasOwnProperty$
|
|
8974
|
+
var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
|
|
8971
8975
|
|
|
8972
8976
|
/**
|
|
8973
8977
|
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
@@ -8981,7 +8985,7 @@ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
|
8981
8985
|
*/
|
|
8982
8986
|
function assignValue(object, key, value) {
|
|
8983
8987
|
var objValue = object[key];
|
|
8984
|
-
if (!(hasOwnProperty$
|
|
8988
|
+
if (!(hasOwnProperty$9.call(object, key) && eq(objValue, value)) ||
|
|
8985
8989
|
(value === undefined && !(key in object))) {
|
|
8986
8990
|
baseAssignValue(object, key, value);
|
|
8987
8991
|
}
|
|
@@ -9187,7 +9191,7 @@ function createAssigner(assigner) {
|
|
|
9187
9191
|
}
|
|
9188
9192
|
|
|
9189
9193
|
/** Used for built-in method references. */
|
|
9190
|
-
var objectProto$
|
|
9194
|
+
var objectProto$a = Object.prototype;
|
|
9191
9195
|
|
|
9192
9196
|
/**
|
|
9193
9197
|
* Checks if `value` is likely a prototype object.
|
|
@@ -9198,7 +9202,7 @@ var objectProto$9 = Object.prototype;
|
|
|
9198
9202
|
*/
|
|
9199
9203
|
function isPrototype(value) {
|
|
9200
9204
|
var Ctor = value && value.constructor,
|
|
9201
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$
|
|
9205
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$a;
|
|
9202
9206
|
|
|
9203
9207
|
return value === proto;
|
|
9204
9208
|
}
|
|
@@ -9237,13 +9241,13 @@ function baseIsArguments(value) {
|
|
|
9237
9241
|
}
|
|
9238
9242
|
|
|
9239
9243
|
/** Used for built-in method references. */
|
|
9240
|
-
var objectProto$
|
|
9244
|
+
var objectProto$9 = Object.prototype;
|
|
9241
9245
|
|
|
9242
9246
|
/** Used to check objects for own properties. */
|
|
9243
|
-
var hasOwnProperty$
|
|
9247
|
+
var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
|
|
9244
9248
|
|
|
9245
9249
|
/** Built-in value references. */
|
|
9246
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
9250
|
+
var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
|
|
9247
9251
|
|
|
9248
9252
|
/**
|
|
9249
9253
|
* Checks if `value` is likely an `arguments` object.
|
|
@@ -9264,7 +9268,7 @@ var propertyIsEnumerable$1 = objectProto$8.propertyIsEnumerable;
|
|
|
9264
9268
|
* // => false
|
|
9265
9269
|
*/
|
|
9266
9270
|
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
9267
|
-
return isObjectLike(value) && hasOwnProperty$
|
|
9271
|
+
return isObjectLike(value) && hasOwnProperty$8.call(value, 'callee') &&
|
|
9268
9272
|
!propertyIsEnumerable$1.call(value, 'callee');
|
|
9269
9273
|
};
|
|
9270
9274
|
|
|
@@ -9437,10 +9441,10 @@ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
|
9437
9441
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
9438
9442
|
|
|
9439
9443
|
/** Used for built-in method references. */
|
|
9440
|
-
var objectProto$
|
|
9444
|
+
var objectProto$8 = Object.prototype;
|
|
9441
9445
|
|
|
9442
9446
|
/** Used to check objects for own properties. */
|
|
9443
|
-
var hasOwnProperty$
|
|
9447
|
+
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
9444
9448
|
|
|
9445
9449
|
/**
|
|
9446
9450
|
* Creates an array of the enumerable property names of the array-like `value`.
|
|
@@ -9460,7 +9464,7 @@ function arrayLikeKeys(value, inherited) {
|
|
|
9460
9464
|
length = result.length;
|
|
9461
9465
|
|
|
9462
9466
|
for (var key in value) {
|
|
9463
|
-
if ((inherited || hasOwnProperty$
|
|
9467
|
+
if ((inherited || hasOwnProperty$7.call(value, key)) &&
|
|
9464
9468
|
!(skipIndexes && (
|
|
9465
9469
|
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
9466
9470
|
key == 'length' ||
|
|
@@ -9495,10 +9499,10 @@ function overArg(func, transform) {
|
|
|
9495
9499
|
var nativeKeys = overArg(Object.keys, Object);
|
|
9496
9500
|
|
|
9497
9501
|
/** Used for built-in method references. */
|
|
9498
|
-
var objectProto$
|
|
9502
|
+
var objectProto$7 = Object.prototype;
|
|
9499
9503
|
|
|
9500
9504
|
/** Used to check objects for own properties. */
|
|
9501
|
-
var hasOwnProperty$
|
|
9505
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
9502
9506
|
|
|
9503
9507
|
/**
|
|
9504
9508
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
@@ -9513,7 +9517,7 @@ function baseKeys(object) {
|
|
|
9513
9517
|
}
|
|
9514
9518
|
var result = [];
|
|
9515
9519
|
for (var key in Object(object)) {
|
|
9516
|
-
if (hasOwnProperty$
|
|
9520
|
+
if (hasOwnProperty$6.call(object, key) && key != 'constructor') {
|
|
9517
9521
|
result.push(key);
|
|
9518
9522
|
}
|
|
9519
9523
|
}
|
|
@@ -9572,10 +9576,10 @@ function nativeKeysIn(object) {
|
|
|
9572
9576
|
}
|
|
9573
9577
|
|
|
9574
9578
|
/** Used for built-in method references. */
|
|
9575
|
-
var objectProto$
|
|
9579
|
+
var objectProto$6 = Object.prototype;
|
|
9576
9580
|
|
|
9577
9581
|
/** Used to check objects for own properties. */
|
|
9578
|
-
var hasOwnProperty$
|
|
9582
|
+
var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
9579
9583
|
|
|
9580
9584
|
/**
|
|
9581
9585
|
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
|
@@ -9592,7 +9596,7 @@ function baseKeysIn(object) {
|
|
|
9592
9596
|
result = [];
|
|
9593
9597
|
|
|
9594
9598
|
for (var key in object) {
|
|
9595
|
-
if (!(key == 'constructor' && (isProto || !hasOwnProperty$
|
|
9599
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty$5.call(object, key)))) {
|
|
9596
9600
|
result.push(key);
|
|
9597
9601
|
}
|
|
9598
9602
|
}
|
|
@@ -9686,10 +9690,10 @@ function hashDelete(key) {
|
|
|
9686
9690
|
var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
|
9687
9691
|
|
|
9688
9692
|
/** Used for built-in method references. */
|
|
9689
|
-
var objectProto$
|
|
9693
|
+
var objectProto$5 = Object.prototype;
|
|
9690
9694
|
|
|
9691
9695
|
/** Used to check objects for own properties. */
|
|
9692
|
-
var hasOwnProperty$
|
|
9696
|
+
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
9693
9697
|
|
|
9694
9698
|
/**
|
|
9695
9699
|
* Gets the hash value for `key`.
|
|
@@ -9706,14 +9710,14 @@ function hashGet(key) {
|
|
|
9706
9710
|
var result = data[key];
|
|
9707
9711
|
return result === HASH_UNDEFINED$2 ? undefined : result;
|
|
9708
9712
|
}
|
|
9709
|
-
return hasOwnProperty$
|
|
9713
|
+
return hasOwnProperty$4.call(data, key) ? data[key] : undefined;
|
|
9710
9714
|
}
|
|
9711
9715
|
|
|
9712
9716
|
/** Used for built-in method references. */
|
|
9713
|
-
var objectProto$
|
|
9717
|
+
var objectProto$4 = Object.prototype;
|
|
9714
9718
|
|
|
9715
9719
|
/** Used to check objects for own properties. */
|
|
9716
|
-
var hasOwnProperty$
|
|
9720
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
9717
9721
|
|
|
9718
9722
|
/**
|
|
9719
9723
|
* Checks if a hash value for `key` exists.
|
|
@@ -9726,7 +9730,7 @@ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
|
9726
9730
|
*/
|
|
9727
9731
|
function hashHas(key) {
|
|
9728
9732
|
var data = this.__data__;
|
|
9729
|
-
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$
|
|
9733
|
+
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$3.call(data, key);
|
|
9730
9734
|
}
|
|
9731
9735
|
|
|
9732
9736
|
/** Used to stand-in for `undefined` hash values. */
|
|
@@ -10371,13 +10375,13 @@ var objectTag$2 = '[object Object]';
|
|
|
10371
10375
|
|
|
10372
10376
|
/** Used for built-in method references. */
|
|
10373
10377
|
var funcProto = Function.prototype,
|
|
10374
|
-
objectProto$
|
|
10378
|
+
objectProto$3 = Object.prototype;
|
|
10375
10379
|
|
|
10376
10380
|
/** Used to resolve the decompiled source of functions. */
|
|
10377
10381
|
var funcToString = funcProto.toString;
|
|
10378
10382
|
|
|
10379
10383
|
/** Used to check objects for own properties. */
|
|
10380
|
-
var hasOwnProperty$
|
|
10384
|
+
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
10381
10385
|
|
|
10382
10386
|
/** Used to infer the `Object` constructor. */
|
|
10383
10387
|
var objectCtorString = funcToString.call(Object);
|
|
@@ -10418,7 +10422,7 @@ function isPlainObject(value) {
|
|
|
10418
10422
|
if (proto === null) {
|
|
10419
10423
|
return true;
|
|
10420
10424
|
}
|
|
10421
|
-
var Ctor = hasOwnProperty$
|
|
10425
|
+
var Ctor = hasOwnProperty$2.call(proto, 'constructor') && proto.constructor;
|
|
10422
10426
|
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
10423
10427
|
funcToString.call(Ctor) == objectCtorString;
|
|
10424
10428
|
}
|
|
@@ -10661,10 +10665,10 @@ function stubArray() {
|
|
|
10661
10665
|
}
|
|
10662
10666
|
|
|
10663
10667
|
/** Used for built-in method references. */
|
|
10664
|
-
var objectProto$
|
|
10668
|
+
var objectProto$2 = Object.prototype;
|
|
10665
10669
|
|
|
10666
10670
|
/** Built-in value references. */
|
|
10667
|
-
var propertyIsEnumerable = objectProto$
|
|
10671
|
+
var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
|
|
10668
10672
|
|
|
10669
10673
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
10670
10674
|
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
@@ -10827,10 +10831,10 @@ if ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2)
|
|
|
10827
10831
|
}
|
|
10828
10832
|
|
|
10829
10833
|
/** Used for built-in method references. */
|
|
10830
|
-
var objectProto = Object.prototype;
|
|
10834
|
+
var objectProto$1 = Object.prototype;
|
|
10831
10835
|
|
|
10832
10836
|
/** Used to check objects for own properties. */
|
|
10833
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
10837
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
10834
10838
|
|
|
10835
10839
|
/**
|
|
10836
10840
|
* Initializes an array clone.
|
|
@@ -10844,7 +10848,7 @@ function initCloneArray(array) {
|
|
|
10844
10848
|
result = new array.constructor(length);
|
|
10845
10849
|
|
|
10846
10850
|
// Add properties assigned by `RegExp#exec`.
|
|
10847
|
-
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
|
10851
|
+
if (length && typeof array[0] == 'string' && hasOwnProperty$1.call(array, 'index')) {
|
|
10848
10852
|
result.index = array.index;
|
|
10849
10853
|
result.input = array.input;
|
|
10850
10854
|
}
|
|
@@ -11753,6 +11757,12 @@ var merge = createAssigner(function(object, source, srcIndex) {
|
|
|
11753
11757
|
baseMerge(object, source, srcIndex);
|
|
11754
11758
|
});
|
|
11755
11759
|
|
|
11760
|
+
/** Used for built-in method references. */
|
|
11761
|
+
var objectProto = Object.prototype;
|
|
11762
|
+
|
|
11763
|
+
/** Used to check objects for own properties. */
|
|
11764
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
11765
|
+
|
|
11756
11766
|
/**
|
|
11757
11767
|
* The base implementation of `_.unset`.
|
|
11758
11768
|
*
|
|
@@ -11763,8 +11773,47 @@ var merge = createAssigner(function(object, source, srcIndex) {
|
|
|
11763
11773
|
*/
|
|
11764
11774
|
function baseUnset(object, path) {
|
|
11765
11775
|
path = castPath(path, object);
|
|
11766
|
-
|
|
11767
|
-
|
|
11776
|
+
|
|
11777
|
+
// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
|
11778
|
+
var index = -1,
|
|
11779
|
+
length = path.length;
|
|
11780
|
+
|
|
11781
|
+
if (!length) {
|
|
11782
|
+
return true;
|
|
11783
|
+
}
|
|
11784
|
+
|
|
11785
|
+
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
|
|
11786
|
+
|
|
11787
|
+
while (++index < length) {
|
|
11788
|
+
var key = path[index];
|
|
11789
|
+
|
|
11790
|
+
// skip non-string keys (e.g., Symbols, numbers)
|
|
11791
|
+
if (typeof key !== 'string') {
|
|
11792
|
+
continue;
|
|
11793
|
+
}
|
|
11794
|
+
|
|
11795
|
+
// Always block "__proto__" anywhere in the path if it's not expected
|
|
11796
|
+
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
|
11797
|
+
return false;
|
|
11798
|
+
}
|
|
11799
|
+
|
|
11800
|
+
// Block "constructor.prototype" chains
|
|
11801
|
+
if (key === 'constructor' &&
|
|
11802
|
+
(index + 1) < length &&
|
|
11803
|
+
typeof path[index + 1] === 'string' &&
|
|
11804
|
+
path[index + 1] === 'prototype') {
|
|
11805
|
+
|
|
11806
|
+
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
|
|
11807
|
+
if (isRootPrimitive && index === 0) {
|
|
11808
|
+
continue;
|
|
11809
|
+
}
|
|
11810
|
+
|
|
11811
|
+
return false;
|
|
11812
|
+
}
|
|
11813
|
+
}
|
|
11814
|
+
|
|
11815
|
+
var obj = parent(object, path);
|
|
11816
|
+
return obj == null || delete obj[toKey(last(path))];
|
|
11768
11817
|
}
|
|
11769
11818
|
|
|
11770
11819
|
/**
|
|
@@ -14223,10 +14272,32 @@ function requireUtils$1 () {
|
|
|
14223
14272
|
hasRequiredUtils$1 = 1;
|
|
14224
14273
|
|
|
14225
14274
|
var formats = /*@__PURE__*/ requireFormats$1();
|
|
14275
|
+
var getSideChannel = requireSideChannel();
|
|
14226
14276
|
|
|
14227
14277
|
var has = Object.prototype.hasOwnProperty;
|
|
14228
14278
|
var isArray = Array.isArray;
|
|
14229
14279
|
|
|
14280
|
+
// Track objects created from arrayLimit overflow using side-channel
|
|
14281
|
+
// Stores the current max numeric index for O(1) lookup
|
|
14282
|
+
var overflowChannel = getSideChannel();
|
|
14283
|
+
|
|
14284
|
+
var markOverflow = function markOverflow(obj, maxIndex) {
|
|
14285
|
+
overflowChannel.set(obj, maxIndex);
|
|
14286
|
+
return obj;
|
|
14287
|
+
};
|
|
14288
|
+
|
|
14289
|
+
var isOverflow = function isOverflow(obj) {
|
|
14290
|
+
return overflowChannel.has(obj);
|
|
14291
|
+
};
|
|
14292
|
+
|
|
14293
|
+
var getMaxIndex = function getMaxIndex(obj) {
|
|
14294
|
+
return overflowChannel.get(obj);
|
|
14295
|
+
};
|
|
14296
|
+
|
|
14297
|
+
var setMaxIndex = function setMaxIndex(obj, maxIndex) {
|
|
14298
|
+
overflowChannel.set(obj, maxIndex);
|
|
14299
|
+
};
|
|
14300
|
+
|
|
14230
14301
|
var hexTable = (function () {
|
|
14231
14302
|
var array = [];
|
|
14232
14303
|
for (var i = 0; i < 256; ++i) {
|
|
@@ -14276,7 +14347,12 @@ function requireUtils$1 () {
|
|
|
14276
14347
|
if (isArray(target)) {
|
|
14277
14348
|
target.push(source);
|
|
14278
14349
|
} else if (target && typeof target === 'object') {
|
|
14279
|
-
if (
|
|
14350
|
+
if (isOverflow(target)) {
|
|
14351
|
+
// Add at next numeric index for overflow objects
|
|
14352
|
+
var newIndex = getMaxIndex(target) + 1;
|
|
14353
|
+
target[newIndex] = source;
|
|
14354
|
+
setMaxIndex(target, newIndex);
|
|
14355
|
+
} else if (
|
|
14280
14356
|
(options && (options.plainObjects || options.allowPrototypes))
|
|
14281
14357
|
|| !has.call(Object.prototype, source)
|
|
14282
14358
|
) {
|
|
@@ -14290,6 +14366,18 @@ function requireUtils$1 () {
|
|
|
14290
14366
|
}
|
|
14291
14367
|
|
|
14292
14368
|
if (!target || typeof target !== 'object') {
|
|
14369
|
+
if (isOverflow(source)) {
|
|
14370
|
+
// Create new object with target at 0, source values shifted by 1
|
|
14371
|
+
var sourceKeys = Object.keys(source);
|
|
14372
|
+
var result = options && options.plainObjects
|
|
14373
|
+
? { __proto__: null, 0: target }
|
|
14374
|
+
: { 0: target };
|
|
14375
|
+
for (var m = 0; m < sourceKeys.length; m++) {
|
|
14376
|
+
var oldKey = parseInt(sourceKeys[m], 10);
|
|
14377
|
+
result[oldKey + 1] = source[sourceKeys[m]];
|
|
14378
|
+
}
|
|
14379
|
+
return markOverflow(result, getMaxIndex(source) + 1);
|
|
14380
|
+
}
|
|
14293
14381
|
return [target].concat(source);
|
|
14294
14382
|
}
|
|
14295
14383
|
|
|
@@ -14461,8 +14549,20 @@ function requireUtils$1 () {
|
|
|
14461
14549
|
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
14462
14550
|
};
|
|
14463
14551
|
|
|
14464
|
-
var combine = function combine(a, b) {
|
|
14465
|
-
|
|
14552
|
+
var combine = function combine(a, b, arrayLimit, plainObjects) {
|
|
14553
|
+
// If 'a' is already an overflow object, add to it
|
|
14554
|
+
if (isOverflow(a)) {
|
|
14555
|
+
var newIndex = getMaxIndex(a) + 1;
|
|
14556
|
+
a[newIndex] = b;
|
|
14557
|
+
setMaxIndex(a, newIndex);
|
|
14558
|
+
return a;
|
|
14559
|
+
}
|
|
14560
|
+
|
|
14561
|
+
var result = [].concat(a, b);
|
|
14562
|
+
if (result.length > arrayLimit) {
|
|
14563
|
+
return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);
|
|
14564
|
+
}
|
|
14565
|
+
return result;
|
|
14466
14566
|
};
|
|
14467
14567
|
|
|
14468
14568
|
var maybeMap = function maybeMap(val, fn) {
|
|
@@ -14484,6 +14584,7 @@ function requireUtils$1 () {
|
|
|
14484
14584
|
decode: decode,
|
|
14485
14585
|
encode: encode,
|
|
14486
14586
|
isBuffer: isBuffer,
|
|
14587
|
+
isOverflow: isOverflow,
|
|
14487
14588
|
isRegExp: isRegExp,
|
|
14488
14589
|
maybeMap: maybeMap,
|
|
14489
14590
|
merge: merge
|
|
@@ -14970,16 +15071,18 @@ function requireParse$1 () {
|
|
|
14970
15071
|
} else {
|
|
14971
15072
|
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
14972
15073
|
|
|
14973
|
-
|
|
14974
|
-
|
|
14975
|
-
|
|
14976
|
-
|
|
14977
|
-
|
|
14978
|
-
|
|
14979
|
-
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
|
|
15074
|
+
if (key !== null) {
|
|
15075
|
+
val = utils.maybeMap(
|
|
15076
|
+
parseArrayValue(
|
|
15077
|
+
part.slice(pos + 1),
|
|
15078
|
+
options,
|
|
15079
|
+
isArray(obj[key]) ? obj[key].length : 0
|
|
15080
|
+
),
|
|
15081
|
+
function (encodedVal) {
|
|
15082
|
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
15083
|
+
}
|
|
15084
|
+
);
|
|
15085
|
+
}
|
|
14983
15086
|
}
|
|
14984
15087
|
|
|
14985
15088
|
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
@@ -14990,11 +15093,18 @@ function requireParse$1 () {
|
|
|
14990
15093
|
val = isArray(val) ? [val] : val;
|
|
14991
15094
|
}
|
|
14992
15095
|
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
14996
|
-
|
|
14997
|
-
|
|
15096
|
+
if (key !== null) {
|
|
15097
|
+
var existing = has.call(obj, key);
|
|
15098
|
+
if (existing && options.duplicates === 'combine') {
|
|
15099
|
+
obj[key] = utils.combine(
|
|
15100
|
+
obj[key],
|
|
15101
|
+
val,
|
|
15102
|
+
options.arrayLimit,
|
|
15103
|
+
options.plainObjects
|
|
15104
|
+
);
|
|
15105
|
+
} else if (!existing || options.duplicates === 'last') {
|
|
15106
|
+
obj[key] = val;
|
|
15107
|
+
}
|
|
14998
15108
|
}
|
|
14999
15109
|
}
|
|
15000
15110
|
|
|
@@ -15015,9 +15125,19 @@ function requireParse$1 () {
|
|
|
15015
15125
|
var root = chain[i];
|
|
15016
15126
|
|
|
15017
15127
|
if (root === '[]' && options.parseArrays) {
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
|
|
15128
|
+
if (utils.isOverflow(leaf)) {
|
|
15129
|
+
// leaf is already an overflow object, preserve it
|
|
15130
|
+
obj = leaf;
|
|
15131
|
+
} else {
|
|
15132
|
+
obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
|
|
15133
|
+
? []
|
|
15134
|
+
: utils.combine(
|
|
15135
|
+
[],
|
|
15136
|
+
leaf,
|
|
15137
|
+
options.arrayLimit,
|
|
15138
|
+
options.plainObjects
|
|
15139
|
+
);
|
|
15140
|
+
}
|
|
15021
15141
|
} else {
|
|
15022
15142
|
obj = options.plainObjects ? { __proto__: null } : {};
|
|
15023
15143
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
@@ -15045,29 +15165,28 @@ function requireParse$1 () {
|
|
|
15045
15165
|
return leaf;
|
|
15046
15166
|
};
|
|
15047
15167
|
|
|
15048
|
-
var
|
|
15049
|
-
if (!givenKey) {
|
|
15050
|
-
return;
|
|
15051
|
-
}
|
|
15052
|
-
|
|
15053
|
-
// Transform dot notation to bracket notation
|
|
15168
|
+
var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
|
|
15054
15169
|
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
15055
15170
|
|
|
15056
|
-
|
|
15171
|
+
if (options.depth <= 0) {
|
|
15172
|
+
if (!options.plainObjects && has.call(Object.prototype, key)) {
|
|
15173
|
+
if (!options.allowPrototypes) {
|
|
15174
|
+
return;
|
|
15175
|
+
}
|
|
15176
|
+
}
|
|
15177
|
+
|
|
15178
|
+
return [key];
|
|
15179
|
+
}
|
|
15057
15180
|
|
|
15058
15181
|
var brackets = /(\[[^[\]]*])/;
|
|
15059
15182
|
var child = /(\[[^[\]]*])/g;
|
|
15060
15183
|
|
|
15061
|
-
|
|
15062
|
-
|
|
15063
|
-
var segment = options.depth > 0 && brackets.exec(key);
|
|
15184
|
+
var segment = brackets.exec(key);
|
|
15064
15185
|
var parent = segment ? key.slice(0, segment.index) : key;
|
|
15065
15186
|
|
|
15066
|
-
// Stash the parent if it exists
|
|
15067
|
-
|
|
15068
15187
|
var keys = [];
|
|
15188
|
+
|
|
15069
15189
|
if (parent) {
|
|
15070
|
-
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
15071
15190
|
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
15072
15191
|
if (!options.allowPrototypes) {
|
|
15073
15192
|
return;
|
|
@@ -15077,28 +15196,42 @@ function requireParse$1 () {
|
|
|
15077
15196
|
keys.push(parent);
|
|
15078
15197
|
}
|
|
15079
15198
|
|
|
15080
|
-
// Loop through children appending to the array until we hit depth
|
|
15081
|
-
|
|
15082
15199
|
var i = 0;
|
|
15083
|
-
while (
|
|
15200
|
+
while ((segment = child.exec(key)) !== null && i < options.depth) {
|
|
15084
15201
|
i += 1;
|
|
15085
|
-
|
|
15202
|
+
|
|
15203
|
+
var segmentContent = segment[1].slice(1, -1);
|
|
15204
|
+
if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
|
|
15086
15205
|
if (!options.allowPrototypes) {
|
|
15087
15206
|
return;
|
|
15088
15207
|
}
|
|
15089
15208
|
}
|
|
15209
|
+
|
|
15090
15210
|
keys.push(segment[1]);
|
|
15091
15211
|
}
|
|
15092
15212
|
|
|
15093
|
-
// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
15094
|
-
|
|
15095
15213
|
if (segment) {
|
|
15096
15214
|
if (options.strictDepth === true) {
|
|
15097
15215
|
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
15098
15216
|
}
|
|
15217
|
+
|
|
15099
15218
|
keys.push('[' + key.slice(segment.index) + ']');
|
|
15100
15219
|
}
|
|
15101
15220
|
|
|
15221
|
+
return keys;
|
|
15222
|
+
};
|
|
15223
|
+
|
|
15224
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
15225
|
+
if (!givenKey) {
|
|
15226
|
+
return;
|
|
15227
|
+
}
|
|
15228
|
+
|
|
15229
|
+
var keys = splitKeyIntoSegments(givenKey, options);
|
|
15230
|
+
|
|
15231
|
+
if (!keys) {
|
|
15232
|
+
return;
|
|
15233
|
+
}
|
|
15234
|
+
|
|
15102
15235
|
return parseObject(keys, val, options, valuesParsed);
|
|
15103
15236
|
};
|
|
15104
15237
|
|
|
@@ -21969,13 +22102,13 @@ function requireDataType () {
|
|
|
21969
22102
|
case "number":
|
|
21970
22103
|
gen
|
|
21971
22104
|
.elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null
|
|
21972
|
-
|| (${dataType} == "string" && ${data} && ${data}
|
|
22105
|
+
|| (${dataType} == "string" && ${data} && ${data} == +${data})`)
|
|
21973
22106
|
.assign(coerced, (0, codegen_1._) `+${data}`);
|
|
21974
22107
|
return;
|
|
21975
22108
|
case "integer":
|
|
21976
22109
|
gen
|
|
21977
22110
|
.elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null
|
|
21978
|
-
|| (${dataType} === "string" && ${data} && ${data}
|
|
22111
|
+
|| (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
|
|
21979
22112
|
.assign(coerced, (0, codegen_1._) `+${data}`);
|
|
21980
22113
|
return;
|
|
21981
22114
|
case "boolean":
|
|
@@ -32567,24 +32700,71 @@ class Comparator {
|
|
|
32567
32700
|
}
|
|
32568
32701
|
}
|
|
32569
32702
|
|
|
32570
|
-
|
|
32571
|
-
|
|
32572
|
-
|
|
32573
|
-
|
|
32574
|
-
|
|
32575
|
-
|
|
32576
|
-
|
|
32577
|
-
|
|
32703
|
+
const MAX_EXIT_CODE = 255;
|
|
32704
|
+
const defaultDependencies = {
|
|
32705
|
+
readFile: (path) => require$$3$2.promises.readFile(path, { encoding: "utf-8" }),
|
|
32706
|
+
fetch: (url) => fetch(url),
|
|
32707
|
+
output: (message) => console.log(message),
|
|
32708
|
+
createComparator: (oas) => new Comparator(oas),
|
|
32709
|
+
};
|
|
32710
|
+
class Runner {
|
|
32711
|
+
deps;
|
|
32712
|
+
constructor(deps = {}) {
|
|
32713
|
+
this.deps = { ...defaultDependencies, ...deps };
|
|
32578
32714
|
}
|
|
32579
|
-
|
|
32715
|
+
isUrl(path) {
|
|
32580
32716
|
try {
|
|
32581
|
-
|
|
32717
|
+
const url = new URL(path);
|
|
32718
|
+
return url.protocol === "http:" || url.protocol === "https:";
|
|
32582
32719
|
}
|
|
32583
|
-
catch
|
|
32584
|
-
|
|
32720
|
+
catch {
|
|
32721
|
+
return false;
|
|
32585
32722
|
}
|
|
32586
32723
|
}
|
|
32587
|
-
|
|
32724
|
+
async readContent(path) {
|
|
32725
|
+
if (this.isUrl(path)) {
|
|
32726
|
+
const response = await this.deps.fetch(path);
|
|
32727
|
+
if (!response.ok) {
|
|
32728
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
32729
|
+
}
|
|
32730
|
+
return response.text();
|
|
32731
|
+
}
|
|
32732
|
+
return this.deps.readFile(path);
|
|
32733
|
+
}
|
|
32734
|
+
parseContent(content) {
|
|
32735
|
+
try {
|
|
32736
|
+
return JSON.parse(content);
|
|
32737
|
+
}
|
|
32738
|
+
catch (error) {
|
|
32739
|
+
try {
|
|
32740
|
+
return jsYaml.load(content);
|
|
32741
|
+
}
|
|
32742
|
+
catch (_err) {
|
|
32743
|
+
throw error;
|
|
32744
|
+
}
|
|
32745
|
+
}
|
|
32746
|
+
}
|
|
32747
|
+
async readAndParse(path) {
|
|
32748
|
+
const content = await this.readContent(path);
|
|
32749
|
+
return this.parseContent(content);
|
|
32750
|
+
}
|
|
32751
|
+
async run(oasPath, pactPaths) {
|
|
32752
|
+
const oas = (await this.readAndParse(oasPath));
|
|
32753
|
+
const comparator = this.deps.createComparator(oas);
|
|
32754
|
+
let errors = 0;
|
|
32755
|
+
for (const pactPath of pactPaths) {
|
|
32756
|
+
const pact = await this.readAndParse(pactPath);
|
|
32757
|
+
const results = [];
|
|
32758
|
+
for await (const result of comparator.compare(pact)) {
|
|
32759
|
+
results.push(result);
|
|
32760
|
+
}
|
|
32761
|
+
errors += results.some((r) => r.type === "error") ? 1 : 0;
|
|
32762
|
+
this.deps.output(JSON.stringify(results));
|
|
32763
|
+
}
|
|
32764
|
+
return Math.min(errors, MAX_EXIT_CODE);
|
|
32765
|
+
}
|
|
32766
|
+
}
|
|
32767
|
+
|
|
32588
32768
|
program
|
|
32589
32769
|
.version(packageJson.version)
|
|
32590
32770
|
.command("opc")
|
|
@@ -32593,22 +32773,12 @@ program
|
|
|
32593
32773
|
Comparison output is presented as ND-JSON, with one line per Pact file.
|
|
32594
32774
|
|
|
32595
32775
|
The exit code equals the number of Pact files with errors (not the number of errors in one comparison).`)
|
|
32596
|
-
.argument("<oas>", "path to
|
|
32597
|
-
.argument("<pact...>", "path(s) to Pact file(s)")
|
|
32776
|
+
.argument("<oas>", "path or URL to OAD file")
|
|
32777
|
+
.argument("<pact...>", "path(s) or URL(s) to Pact file(s)")
|
|
32598
32778
|
.action(async (oasPath, pactPaths) => {
|
|
32599
|
-
const
|
|
32600
|
-
const
|
|
32601
|
-
|
|
32602
|
-
for (const pactPath of pactPaths) {
|
|
32603
|
-
const pact = await readAndParse(pactPath);
|
|
32604
|
-
const results = [];
|
|
32605
|
-
for await (const result of comparator.compare(pact)) {
|
|
32606
|
-
results.push(result);
|
|
32607
|
-
}
|
|
32608
|
-
errors += results.some((r) => r.type === "error") ? 1 : 0;
|
|
32609
|
-
console.log(JSON.stringify(results));
|
|
32610
|
-
}
|
|
32611
|
-
process.exit(errors);
|
|
32779
|
+
const runner = new Runner();
|
|
32780
|
+
const exitCode = await runner.run(oasPath, pactPaths);
|
|
32781
|
+
process.exit(exitCode);
|
|
32612
32782
|
})
|
|
32613
32783
|
.parse(process.argv);
|
|
32614
32784
|
//# sourceMappingURL=cli.cjs.map
|