@systemfsoftware/stryker-js 5.0.0 → 6.1.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/CHANGELOG.md +68 -0
- package/README.md +144 -39
- package/dist/Plugins-DF95m9KO.d.mts +1400 -0
- package/dist/{builtin-reporters-wAuKFSsd.mjs → builtin-reporters-BqePgAN0.mjs} +3 -4
- package/dist/builtin-reporters.d.mts +299 -1
- package/dist/builtin-reporters.mjs +3 -2
- package/dist/compiler-C8aLIb5U.mjs +48406 -0
- package/dist/config.d.mts +2 -1
- package/dist/dist-CWbipfGB.mjs +711 -0
- package/dist/index-BInJWa0x.d.mts +1148 -0
- package/dist/index.d.mts +2538 -312
- package/dist/index.mjs +4 -3
- package/dist/main.mjs +499 -1893
- package/dist/{mutation-test.cell-RmF-sBUm.d.mts → mutation-test.cell-Cw1ZzDnb.d.mts} +70 -18
- package/dist/plugin-loader.d.mts +1577 -10
- package/dist/plugin-loader.mjs +3 -2
- package/dist/{plugin-worker-entry-DNu0SHO8.mjs → plugin-worker-entry-D00fedxV.mjs} +356 -184
- package/dist/promises.d.mts +2 -2
- package/dist/promises.mjs +1 -1
- package/dist/rolldown-runtime-XITHOX9H.mjs +15 -0
- package/dist/src-BoVgxGWD.mjs +12466 -0
- package/dist/src-js-DRK8boNV.mjs +1009 -0
- package/dist/{stryker-config-BlfHxS7n.d.mts → stryker-config-DIGmQrm1.d.mts} +2 -2
- package/package.json +35 -13
- package/dist/Plugins-sA_9VKus.d.mts +0 -96
- package/dist/src-Bzh7ykDp.mjs +0 -4724
package/dist/main.mjs
CHANGED
|
@@ -1325,7 +1325,7 @@ const random = (self) => {
|
|
|
1325
1325
|
* @category hashing
|
|
1326
1326
|
* @since 2.0.0
|
|
1327
1327
|
*/
|
|
1328
|
-
const combine$
|
|
1328
|
+
const combine$3 = /*#__PURE__*/ dual(2, (self, b) => self * 53 ^ b);
|
|
1329
1329
|
/**
|
|
1330
1330
|
* Applies bit manipulation techniques to optimize a hash value.
|
|
1331
1331
|
*
|
|
@@ -1488,7 +1488,7 @@ const string$7 = (str) => {
|
|
|
1488
1488
|
*/
|
|
1489
1489
|
const structureKeys = (o, keys) => {
|
|
1490
1490
|
let h = 12289;
|
|
1491
|
-
for (const key of keys) h ^= combine$
|
|
1491
|
+
for (const key of keys) h ^= combine$3(hash(key), hash(o[key]));
|
|
1492
1492
|
return optimize(h);
|
|
1493
1493
|
};
|
|
1494
1494
|
/**
|
|
@@ -1566,7 +1566,7 @@ const iterableWith = (seed, f) => (iter) => {
|
|
|
1566
1566
|
* @since 2.0.0
|
|
1567
1567
|
*/
|
|
1568
1568
|
const array = /*#__PURE__*/ iterableWith(6151, hash);
|
|
1569
|
-
const hashMap = /*#__PURE__*/ iterableWith(/*#__PURE__*/ string$7("Map"), ([k, v]) => combine$
|
|
1569
|
+
const hashMap = /*#__PURE__*/ iterableWith(/*#__PURE__*/ string$7("Map"), ([k, v]) => combine$3(hash(k), hash(v)));
|
|
1570
1570
|
const hashSet = /*#__PURE__*/ iterableWith(/*#__PURE__*/ string$7("Set"), hash);
|
|
1571
1571
|
const randomHashCache = /*#__PURE__*/ new WeakMap();
|
|
1572
1572
|
const hashCache = /*#__PURE__*/ new WeakMap();
|
|
@@ -2562,7 +2562,7 @@ var Fail = class extends ReasonBase {
|
|
|
2562
2562
|
return isFailReason$1(that) && equals$2(this.error, that.error) && equals$2(this.annotations, that.annotations);
|
|
2563
2563
|
}
|
|
2564
2564
|
[symbol$2]() {
|
|
2565
|
-
return combine$
|
|
2565
|
+
return combine$3(string$7(this._tag))(combine$3(hash(this.error))(hash(this.annotations)));
|
|
2566
2566
|
}
|
|
2567
2567
|
};
|
|
2568
2568
|
/** @internal */
|
|
@@ -2591,7 +2591,7 @@ var Die = class extends ReasonBase {
|
|
|
2591
2591
|
return isDieReason$1(that) && equals$2(this.defect, that.defect) && equals$2(this.annotations, that.annotations);
|
|
2592
2592
|
}
|
|
2593
2593
|
[symbol$2]() {
|
|
2594
|
-
return combine$
|
|
2594
|
+
return combine$3(string$7(this._tag))(combine$3(hash(this.defect))(hash(this.annotations)));
|
|
2595
2595
|
}
|
|
2596
2596
|
};
|
|
2597
2597
|
/** @internal */
|
|
@@ -2651,7 +2651,7 @@ const makeExit = (options) => {
|
|
|
2651
2651
|
return isExit$1(that) && that._tag === this._tag && equals$2(this[args], that[args]);
|
|
2652
2652
|
},
|
|
2653
2653
|
[symbol$2]() {
|
|
2654
|
-
return combine$
|
|
2654
|
+
return combine$3(string$7(options.op), hash(this[args]));
|
|
2655
2655
|
}
|
|
2656
2656
|
};
|
|
2657
2657
|
return function(value) {
|
|
@@ -2950,7 +2950,7 @@ const SomeProto = /*#__PURE__*/ Object.defineProperty(/*#__PURE__*/ Object.assig
|
|
|
2950
2950
|
return isOption$1(that) && isSome$1(that) && equals$2(this.value, that.value);
|
|
2951
2951
|
},
|
|
2952
2952
|
[symbol$2]() {
|
|
2953
|
-
return combine$
|
|
2953
|
+
return combine$3(hash(this._tag))(hash(this.value));
|
|
2954
2954
|
},
|
|
2955
2955
|
toString() {
|
|
2956
2956
|
return `some(${format$2(this.value)})`;
|
|
@@ -3021,7 +3021,7 @@ const SuccessProto = /*#__PURE__*/ Object.assign(/*#__PURE__*/ Object.create(Com
|
|
|
3021
3021
|
return isResult$1(that) && isSuccess$2(that) && equals$2(this.success, that.success);
|
|
3022
3022
|
},
|
|
3023
3023
|
[symbol$2]() {
|
|
3024
|
-
return combine$
|
|
3024
|
+
return combine$3(hash(this._tag))(hash(this.success));
|
|
3025
3025
|
},
|
|
3026
3026
|
toString() {
|
|
3027
3027
|
return `success(${format$2(this.success)})`;
|
|
@@ -3041,7 +3041,7 @@ const FailureProto = /*#__PURE__*/ Object.assign(/*#__PURE__*/ Object.create(Com
|
|
|
3041
3041
|
return isResult$1(that) && isFailure$2(that) && equals$2(this.failure, that.failure);
|
|
3042
3042
|
},
|
|
3043
3043
|
[symbol$2]() {
|
|
3044
|
-
return combine$
|
|
3044
|
+
return combine$3(hash(this._tag))(hash(this.failure));
|
|
3045
3045
|
},
|
|
3046
3046
|
toString() {
|
|
3047
3047
|
return `failure(${format$2(this.failure)})`;
|
|
@@ -3549,7 +3549,7 @@ const isSome = isSome$1;
|
|
|
3549
3549
|
* @category pattern matching
|
|
3550
3550
|
* @since 2.0.0
|
|
3551
3551
|
*/
|
|
3552
|
-
const match$
|
|
3552
|
+
const match$6 = /*#__PURE__*/ dual(2, (self, { onNone, onSome }) => isNone(self) ? onNone() : onSome(self.value));
|
|
3553
3553
|
/**
|
|
3554
3554
|
* Extracts the value from a `Some`, or evaluates a fallback thunk on `None`.
|
|
3555
3555
|
*
|
|
@@ -3994,7 +3994,7 @@ const toArray = (self) => isNone(self) ? [] : [self.value];
|
|
|
3994
3994
|
* @category filtering
|
|
3995
3995
|
* @since 2.0.0
|
|
3996
3996
|
*/
|
|
3997
|
-
const filter$
|
|
3997
|
+
const filter$2 = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some(self.value) : none());
|
|
3998
3998
|
/**
|
|
3999
3999
|
* Lifts a `Predicate` or `Refinement` into the `Option` context: returns
|
|
4000
4000
|
* `Some(value)` when the predicate holds, `None` otherwise.
|
|
@@ -4976,7 +4976,7 @@ const map$11 = /*#__PURE__*/ dual(2, (self, f) => isSuccess$1(self) ? succeed$8(
|
|
|
4976
4976
|
* @category pattern matching
|
|
4977
4977
|
* @since 2.0.0
|
|
4978
4978
|
*/
|
|
4979
|
-
const match$
|
|
4979
|
+
const match$5 = /*#__PURE__*/ dual(2, (self, { onFailure, onSuccess }) => isFailure$1(self) ? onFailure(self.failure) : onSuccess(self.success));
|
|
4980
4980
|
/**
|
|
4981
4981
|
* Chains a function that returns a `Result` onto a successful value.
|
|
4982
4982
|
*
|
|
@@ -5163,7 +5163,7 @@ const has$4 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key));
|
|
|
5163
5163
|
* @category filtering
|
|
5164
5164
|
* @since 2.0.0
|
|
5165
5165
|
*/
|
|
5166
|
-
const filter$
|
|
5166
|
+
const filter$1 = /*#__PURE__*/ dual(2, (self, predicate) => {
|
|
5167
5167
|
const out = empty$10();
|
|
5168
5168
|
for (const key of keys$3(self)) if (predicate(self[key], key)) assignProperty$1(out, key, self[key]);
|
|
5169
5169
|
return out;
|
|
@@ -5444,7 +5444,7 @@ const ensure = (self) => Array$1.isArray(self) ? self : [self];
|
|
|
5444
5444
|
* @category pattern matching
|
|
5445
5445
|
* @since 2.0.0
|
|
5446
5446
|
*/
|
|
5447
|
-
const match$
|
|
5447
|
+
const match$4 = /*#__PURE__*/ dual(2, (self, { onEmpty, onNonEmpty }) => isReadonlyArrayNonEmpty(self) ? onNonEmpty(self) : onEmpty());
|
|
5448
5448
|
/**
|
|
5449
5449
|
* Adds a single element to the end of an iterable, returning a `NonEmptyArray`.
|
|
5450
5450
|
*
|
|
@@ -5890,7 +5890,7 @@ const map$10 = /*#__PURE__*/ dual(2, (self, f) => self.map(f));
|
|
|
5890
5890
|
* @category folding
|
|
5891
5891
|
* @since 2.0.0
|
|
5892
5892
|
*/
|
|
5893
|
-
const reduce$
|
|
5893
|
+
const reduce$4 = /*#__PURE__*/ dual(3, (self, b, f) => fromIterable$6(self).reduce((b, a, i) => f(b, a, i), b));
|
|
5894
5894
|
/**
|
|
5895
5895
|
* Removes duplicates using `Equal.equivalence()`, preserving the order of the
|
|
5896
5896
|
* first occurrence.
|
|
@@ -6373,7 +6373,7 @@ const weeks = (weeks) => make$41(weeks * 6048e5);
|
|
|
6373
6373
|
* @category getters
|
|
6374
6374
|
* @since 2.0.0
|
|
6375
6375
|
*/
|
|
6376
|
-
const toMillis = (self) => match$
|
|
6376
|
+
const toMillis = (self) => match$3(fromInputUnsafe(self), {
|
|
6377
6377
|
onMillis: identity,
|
|
6378
6378
|
onNanos: (nanos) => Number(nanos) / 1e6,
|
|
6379
6379
|
onInfinity: () => Infinity,
|
|
@@ -6394,7 +6394,7 @@ const toMillis = (self) => match$4(fromInputUnsafe(self), {
|
|
|
6394
6394
|
* @category getters
|
|
6395
6395
|
* @since 2.0.0
|
|
6396
6396
|
*/
|
|
6397
|
-
const toSeconds = (self) => match$
|
|
6397
|
+
const toSeconds = (self) => match$3(fromInputUnsafe(self), {
|
|
6398
6398
|
onMillis: (millis) => millis / 1e3,
|
|
6399
6399
|
onNanos: (nanos) => Number(nanos) / 1e9,
|
|
6400
6400
|
onInfinity: () => Infinity,
|
|
@@ -6464,7 +6464,7 @@ const toNanosUnsafe = (input) => {
|
|
|
6464
6464
|
* @category pattern matching
|
|
6465
6465
|
* @since 2.0.0
|
|
6466
6466
|
*/
|
|
6467
|
-
const match$
|
|
6467
|
+
const match$3 = /*#__PURE__*/ dual(2, (self, options) => {
|
|
6468
6468
|
switch (self.value._tag) {
|
|
6469
6469
|
case "Millis": return options.onMillis(self.value.millis);
|
|
6470
6470
|
case "Nanos": return options.onNanos(self.value.nanos);
|
|
@@ -7643,7 +7643,7 @@ var Interrupt = class extends ReasonBase {
|
|
|
7643
7643
|
return isInterruptReason(that) && this.fiberId === that.fiberId && this.annotations === that.annotations;
|
|
7644
7644
|
}
|
|
7645
7645
|
[symbol$2]() {
|
|
7646
|
-
return combine$
|
|
7646
|
+
return combine$3(string$7(`${this._tag}:${this.fiberId}`))(random(this.annotations));
|
|
7647
7647
|
}
|
|
7648
7648
|
};
|
|
7649
7649
|
/** @internal */
|
|
@@ -8128,7 +8128,7 @@ const suspend$4 = /*#__PURE__*/ makePrimitive$1({
|
|
|
8128
8128
|
/** @internal */
|
|
8129
8129
|
const fromOption$1 = /*#__PURE__*/ dual((args) => args.length >= 2 || isOption(args[0]), (option, onNone) => isNone(option) ? fail$3(onNone ? onNone() : new NoSuchElementError("Effect.fromOption: Option.none")) : succeed$7(option.value));
|
|
8130
8130
|
/** @internal */
|
|
8131
|
-
const fromResult$1 = /*#__PURE__*/ match$
|
|
8131
|
+
const fromResult$1 = /*#__PURE__*/ match$5({
|
|
8132
8132
|
onFailure: fail$3,
|
|
8133
8133
|
onSuccess: succeed$7
|
|
8134
8134
|
});
|
|
@@ -8319,7 +8319,7 @@ const asSome = (self) => map$9(self, some);
|
|
|
8319
8319
|
/** @internal */
|
|
8320
8320
|
const andThen$3 = /*#__PURE__*/ dual(2, (self, f) => flatMap$3(self, (a) => isEffect$1(f) ? f : internalCall(() => f(a))));
|
|
8321
8321
|
/** @internal */
|
|
8322
|
-
const tap$
|
|
8322
|
+
const tap$2 = /*#__PURE__*/ dual(2, (self, f) => flatMap$3(self, (a) => as$1(isEffect$1(f) ? f : internalCall(() => f(a)), a)));
|
|
8323
8323
|
/** @internal */
|
|
8324
8324
|
const asVoid$1 = (self) => flatMap$3(self, (_) => exitVoid);
|
|
8325
8325
|
/** @internal */
|
|
@@ -8578,7 +8578,7 @@ const ignoreCause$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, o
|
|
|
8578
8578
|
});
|
|
8579
8579
|
});
|
|
8580
8580
|
/** @internal */
|
|
8581
|
-
const option$2 = (self) => match$
|
|
8581
|
+
const option$2 = (self) => match$2(self, {
|
|
8582
8582
|
onFailure: none,
|
|
8583
8583
|
onSuccess: some
|
|
8584
8584
|
});
|
|
@@ -8611,7 +8611,7 @@ const matchEffect$2 = /*#__PURE__*/ dual(2, (self, options) => matchCauseEffect$
|
|
|
8611
8611
|
onSuccess: options.onSuccess
|
|
8612
8612
|
}));
|
|
8613
8613
|
/** @internal */
|
|
8614
|
-
const match$
|
|
8614
|
+
const match$2 = /*#__PURE__*/ dual(2, (self, options) => matchEffect$2(self, {
|
|
8615
8615
|
onFailure: (error) => sync$1(() => options.onFailure(error)),
|
|
8616
8616
|
onSuccess: (value) => sync$1(() => options.onSuccess(value))
|
|
8617
8617
|
}));
|
|
@@ -8623,7 +8623,7 @@ const matchEager = /*#__PURE__*/ dual(2, (self, options) => {
|
|
|
8623
8623
|
if (isFailure$1(error)) return self;
|
|
8624
8624
|
return exitSucceed(options.onFailure(error.success));
|
|
8625
8625
|
}
|
|
8626
|
-
return match$
|
|
8626
|
+
return match$2(self, options);
|
|
8627
8627
|
});
|
|
8628
8628
|
/** @internal */
|
|
8629
8629
|
const exit$1 = (self) => effectIsExit(self) ? exitSucceed(self) : exitPrimitive(self);
|
|
@@ -8780,7 +8780,7 @@ const scopedWith$1 = (f) => suspend$4(() => {
|
|
|
8780
8780
|
return onExit$1(f(scope), (exit) => suspend$4(() => scopeCloseUnsafe(scope, exit) ?? void_$3));
|
|
8781
8781
|
});
|
|
8782
8782
|
/** @internal */
|
|
8783
|
-
const acquireRelease$1 = (acquire, release, options) => contextWith$1((context) => uninterruptibleMask$1((restore) => flatMap$3(scope$1, (scope) => tap$
|
|
8783
|
+
const acquireRelease$1 = (acquire, release, options) => contextWith$1((context) => uninterruptibleMask$1((restore) => flatMap$3(scope$1, (scope) => tap$2(options?.interruptible ? restore(acquire) : acquire, (a) => scopeAddFinalizerExit(scope, (exit) => provideContext$3(release(a, exit), context))))));
|
|
8784
8784
|
/** @internal */
|
|
8785
8785
|
const addFinalizer$2 = (finalizer) => flatMap$3(scope$1, (scope) => contextWith$1((context) => scopeAddFinalizerExit(scope, (exit) => provideContext$3(finalizer(exit), context))));
|
|
8786
8786
|
/** @internal */
|
|
@@ -8877,6 +8877,23 @@ const all$1 = (arg, options) => {
|
|
|
8877
8877
|
});
|
|
8878
8878
|
};
|
|
8879
8879
|
/** @internal */
|
|
8880
|
+
const reduce$3 = /*#__PURE__*/ dual(3, (elements, zero, f) => {
|
|
8881
|
+
const arr = fromIterable$6(elements);
|
|
8882
|
+
if (arr.length === 0) return sync$1(zero);
|
|
8883
|
+
return suspend$4(() => {
|
|
8884
|
+
let index = 0;
|
|
8885
|
+
let state = zero();
|
|
8886
|
+
return map$9(whileLoop$1({
|
|
8887
|
+
while: () => index < arr.length,
|
|
8888
|
+
body: () => f(state, arr[index], index),
|
|
8889
|
+
step(next) {
|
|
8890
|
+
state = next;
|
|
8891
|
+
index++;
|
|
8892
|
+
}
|
|
8893
|
+
}), () => state);
|
|
8894
|
+
});
|
|
8895
|
+
});
|
|
8896
|
+
/** @internal */
|
|
8880
8897
|
const whileLoop$1 = /*#__PURE__*/ makePrimitive$1({
|
|
8881
8898
|
op: "While",
|
|
8882
8899
|
[contA](value, fiber) {
|
|
@@ -10469,7 +10486,7 @@ const isFailure = exitIsFailure;
|
|
|
10469
10486
|
* @category pattern matching
|
|
10470
10487
|
* @since 2.0.0
|
|
10471
10488
|
*/
|
|
10472
|
-
const match$
|
|
10489
|
+
const match$1 = exitMatch;
|
|
10473
10490
|
const DeferredProto = {
|
|
10474
10491
|
["~effect/Deferred"]: {
|
|
10475
10492
|
_A: identity,
|
|
@@ -12081,27 +12098,6 @@ const provideMerge = /*#__PURE__*/ dual(2, (self, that) => provideWith(self, tha
|
|
|
12081
12098
|
* @since 2.0.0
|
|
12082
12099
|
*/
|
|
12083
12100
|
const flatMap$2 = /*#__PURE__*/ dual(2, (self, f) => fromBuild((memoMap, scope) => flatMap$3(self.build(memoMap, scope), (context) => f(context).build(memoMap, scope))));
|
|
12084
|
-
/**
|
|
12085
|
-
* Performs the specified effect if this layer succeeds.
|
|
12086
|
-
*
|
|
12087
|
-
* **When to use**
|
|
12088
|
-
*
|
|
12089
|
-
* Use to run an effectful observation after a layer has been built
|
|
12090
|
-
* successfully, such as logging or metrics, without changing the services the
|
|
12091
|
-
* layer provides.
|
|
12092
|
-
*
|
|
12093
|
-
* **Details**
|
|
12094
|
-
*
|
|
12095
|
-
* The callback receives the services produced by this layer. Its result is
|
|
12096
|
-
* discarded, and the original layer output is preserved.
|
|
12097
|
-
*
|
|
12098
|
-
* @see {@link tapError} for running an effect when layer construction fails with a typed error
|
|
12099
|
-
* @see {@link tapCause} for running an effect when layer construction fails with any cause
|
|
12100
|
-
*
|
|
12101
|
-
* @category sequencing
|
|
12102
|
-
* @since 2.0.0
|
|
12103
|
-
*/
|
|
12104
|
-
const tap$2 = /*#__PURE__*/ dual(2, (self, f) => fromBuild((memoMap, scope) => flatMap$3(self.build(memoMap, scope), (context) => provide$4(as$1(f(context), context), scope))));
|
|
12105
12101
|
//#endregion
|
|
12106
12102
|
//#region ../../node_modules/.pnpm/effect@4.0.0-rc.112/node_modules/effect/dist/Clock.js
|
|
12107
12103
|
/**
|
|
@@ -13189,6 +13185,44 @@ const isEffect = isEffect$1;
|
|
|
13189
13185
|
*/
|
|
13190
13186
|
const all = all$1;
|
|
13191
13187
|
/**
|
|
13188
|
+
* Reduces elements from left to right with an effectful accumulator function.
|
|
13189
|
+
*
|
|
13190
|
+
* **When to use**
|
|
13191
|
+
*
|
|
13192
|
+
* Use when each accumulation step is effectful and must run sequentially in
|
|
13193
|
+
* iteration order.
|
|
13194
|
+
*
|
|
13195
|
+
* **Details**
|
|
13196
|
+
*
|
|
13197
|
+
* The accumulator function receives the current accumulator, the current
|
|
13198
|
+
* element, and its zero-based index. The `zero` function is evaluated each
|
|
13199
|
+
* time the effect runs. An empty iterable succeeds with its result. If a step
|
|
13200
|
+
* fails, remaining elements are not processed.
|
|
13201
|
+
*
|
|
13202
|
+
* **Example** (Summing values sequentially)
|
|
13203
|
+
*
|
|
13204
|
+
* ```ts import.meta.vitest
|
|
13205
|
+
* import { Effect } from "effect"
|
|
13206
|
+
* const output: Array<unknown> = []
|
|
13207
|
+
*
|
|
13208
|
+
* const program = Effect.reduce(
|
|
13209
|
+
* [1, 2, 3],
|
|
13210
|
+
* () => 0,
|
|
13211
|
+
* (total, value, index) =>
|
|
13212
|
+
* Effect.sync(() => { output.push(`Adding ${value} at index ${index}`) }).pipe(
|
|
13213
|
+
* Effect.as(total + value)
|
|
13214
|
+
* )
|
|
13215
|
+
* )
|
|
13216
|
+
*
|
|
13217
|
+
* void output.push(await Effect.runPromise(program))
|
|
13218
|
+
* output // => ["Adding 1 at index 0", "Adding 2 at index 1", "Adding 3 at index 2", 6]
|
|
13219
|
+
* ```
|
|
13220
|
+
*
|
|
13221
|
+
* @category folding
|
|
13222
|
+
* @since 2.0.0
|
|
13223
|
+
*/
|
|
13224
|
+
const reduce$2 = reduce$3;
|
|
13225
|
+
/**
|
|
13192
13226
|
* Executes an effectful operation for each element in an `Iterable`.
|
|
13193
13227
|
*
|
|
13194
13228
|
* **When to use**
|
|
@@ -14155,7 +14189,7 @@ const andThen$2 = andThen$3;
|
|
|
14155
14189
|
* @category sequencing
|
|
14156
14190
|
* @since 2.0.0
|
|
14157
14191
|
*/
|
|
14158
|
-
const tap$1 = tap$
|
|
14192
|
+
const tap$1 = tap$2;
|
|
14159
14193
|
/**
|
|
14160
14194
|
* Converts both success and failure of an `Effect` into a `Result` type.
|
|
14161
14195
|
*
|
|
@@ -15390,7 +15424,7 @@ const when$2 = when$3;
|
|
|
15390
15424
|
* @category pattern matching
|
|
15391
15425
|
* @since 2.0.0
|
|
15392
15426
|
*/
|
|
15393
|
-
const match
|
|
15427
|
+
const match = match$2;
|
|
15394
15428
|
/**
|
|
15395
15429
|
* Handles failures with access to the cause and allows performing side effects.
|
|
15396
15430
|
*
|
|
@@ -21406,7 +21440,7 @@ const merge$1 = /*#__PURE__*/ dual((args) => isStream(args[0]) && isStream(args[
|
|
|
21406
21440
|
* @category filtering
|
|
21407
21441
|
* @since 2.0.0
|
|
21408
21442
|
*/
|
|
21409
|
-
const filter
|
|
21443
|
+
const filter = /*#__PURE__*/ dual(2, (self, predicate) => fromChannel(filterArray(toChannel(self), predicate)));
|
|
21410
21444
|
/**
|
|
21411
21445
|
* Drops the first `n` elements from this stream.
|
|
21412
21446
|
*
|
|
@@ -22030,7 +22064,7 @@ const make$31 = (impl) => FileSystem.of({
|
|
|
22030
22064
|
return fromPull(succeed$4(flatMap$1(suspend$3(() => {
|
|
22031
22065
|
if (bytesToRead !== void 0 && bytesToRead <= totalBytesRead) return done$1();
|
|
22032
22066
|
return bytesToRead !== void 0 && bytesToRead - totalBytesRead < chunkSize ? file.readAlloc(bytesToRead - totalBytesRead) : readChunk;
|
|
22033
|
-
}), match$
|
|
22067
|
+
}), match$6({
|
|
22034
22068
|
onNone: () => done$1(),
|
|
22035
22069
|
onSome: (buf) => {
|
|
22036
22070
|
totalBytesRead += BigInt(buf.length);
|
|
@@ -23764,7 +23798,7 @@ const layer$12 = (loggers, options) => effect(CurrentLoggers, withFiber$1(fnUntr
|
|
|
23764
23798
|
//#region package.json
|
|
23765
23799
|
var package_default = {
|
|
23766
23800
|
name: "@systemfsoftware/stryker-js",
|
|
23767
|
-
version: "
|
|
23801
|
+
version: "6.1.0",
|
|
23768
23802
|
repository: {
|
|
23769
23803
|
"type": "git",
|
|
23770
23804
|
"url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
|
|
@@ -23781,6 +23815,7 @@ var package_default = {
|
|
|
23781
23815
|
"build": "rimraf dist && tsdown --config tsdown.bin.config.ts && tsdown --config tsdown.config.ts",
|
|
23782
23816
|
"typecheck": "tsc --noEmit --incremental && tsc -p tsconfig.node.json --noEmit",
|
|
23783
23817
|
"test": "vitest run",
|
|
23818
|
+
"mutation": "stryker run",
|
|
23784
23819
|
"attw": "attw --pack .",
|
|
23785
23820
|
"lint": "f=${OXLINT_FORMAT:-${AGENT:+agent}}; oxlint . --format=${f:-default}",
|
|
23786
23821
|
"api:check": "concurrently --kill-others-on-fail \"api-extractor run\" \"api-extractor run --config api-extractor.builtin-reporters.json\" \"api-extractor run --config api-extractor.plugin-loader.json\"",
|
|
@@ -23797,14 +23832,7 @@ var package_default = {
|
|
|
23797
23832
|
"@opentelemetry/api": "^1.9.0",
|
|
23798
23833
|
"@opentelemetry/exporter-trace-otlp-http": "^0.208.0",
|
|
23799
23834
|
"@opentelemetry/sdk-trace-base": "^2.2.0",
|
|
23800
|
-
"@systemfsoftware/effect-cell-types": "catalog:"
|
|
23801
|
-
"@systemfsoftware/stryker-ignorer-interface": "workspace:^",
|
|
23802
|
-
"@systemfsoftware/stryker-js-html-reporter": "workspace:^",
|
|
23803
|
-
"@systemfsoftware/stryker-js-instrumenter": "workspace:^",
|
|
23804
|
-
"@systemfsoftware/stryker-js-plugin-interface": "workspace:^",
|
|
23805
|
-
"@systemfsoftware/stryker-js-plugin-runtime": "workspace:^",
|
|
23806
|
-
"diff-match-patch": "1.0.5",
|
|
23807
|
-
"minimatch": "~10.2.4"
|
|
23835
|
+
"@systemfsoftware/effect-cell-types": "catalog:"
|
|
23808
23836
|
},
|
|
23809
23837
|
peerDependencies: { "effect": "catalog:" },
|
|
23810
23838
|
devDependencies: {
|
|
@@ -23818,12 +23846,21 @@ var package_default = {
|
|
|
23818
23846
|
"@systemfsoftware/effect-gherkin-spec": "catalog:",
|
|
23819
23847
|
"@systemfsoftware/effect-schema-law": "catalog:",
|
|
23820
23848
|
"@systemfsoftware/effect-schema-vite": "catalog:",
|
|
23821
|
-
"@systemfsoftware/stryker-
|
|
23822
|
-
"@systemfsoftware/stryker-ignorer-
|
|
23849
|
+
"@systemfsoftware/stryker-config": "workspace:^",
|
|
23850
|
+
"@systemfsoftware/stryker-ignorer-effect-schema-declarations": "catalog:stryker",
|
|
23851
|
+
"@systemfsoftware/stryker-ignorer-in-source-vitest-block": "catalog:stryker",
|
|
23852
|
+
"@systemfsoftware/stryker-ignorer-interface": "workspace:^",
|
|
23853
|
+
"@systemfsoftware/stryker-js": "catalog:stryker",
|
|
23854
|
+
"@systemfsoftware/stryker-js-html-reporter": "workspace:^",
|
|
23855
|
+
"@systemfsoftware/stryker-js-instrumenter": "workspace:^",
|
|
23856
|
+
"@systemfsoftware/stryker-js-plugin-interface": "workspace:^",
|
|
23857
|
+
"@systemfsoftware/stryker-js-plugin-runtime": "workspace:^",
|
|
23858
|
+
"@systemfsoftware/stryker-js-typescript-checker": "catalog:stryker",
|
|
23859
|
+
"@systemfsoftware/stryker-js-vitest-runner": "catalog:stryker",
|
|
23860
|
+
"@systemfsoftware/stryker-test-contribution": "catalog:stryker",
|
|
23823
23861
|
"@systemfsoftware/tsconfig": "catalog:",
|
|
23824
23862
|
"@systemfsoftware/tsdown-config": "workspace:^",
|
|
23825
23863
|
"@systemfsoftware/vitest-config": "workspace:^",
|
|
23826
|
-
"@types/diff-match-patch": "1.0.36",
|
|
23827
23864
|
"@types/node": "catalog:",
|
|
23828
23865
|
"@vitest/coverage-v8": "catalog:",
|
|
23829
23866
|
"concurrently": "catalog:",
|
|
@@ -23891,7 +23928,28 @@ var package_default = {
|
|
|
23891
23928
|
},
|
|
23892
23929
|
"./package.json": "./package.json"
|
|
23893
23930
|
},
|
|
23894
|
-
inlinedDependencies: {
|
|
23931
|
+
inlinedDependencies: {
|
|
23932
|
+
"@eslint-community/regexpp": "4.12.2",
|
|
23933
|
+
"@jridgewell/gen-mapping": "0.3.13",
|
|
23934
|
+
"@jridgewell/remapping": "2.3.5",
|
|
23935
|
+
"@jridgewell/resolve-uri": "3.1.2",
|
|
23936
|
+
"@jridgewell/sourcemap-codec": "1.6.0",
|
|
23937
|
+
"@jridgewell/trace-mapping": "0.3.31",
|
|
23938
|
+
"@jsr/std__jsonc": "1.0.2",
|
|
23939
|
+
"@sveltejs/acorn-typescript": "1.0.13",
|
|
23940
|
+
"acorn": "8.18.0",
|
|
23941
|
+
"angular-html-parser": "10.4.0",
|
|
23942
|
+
"aria-query": "5.3.1",
|
|
23943
|
+
"axobject-query": "4.1.0",
|
|
23944
|
+
"esrap": "2.3.7",
|
|
23945
|
+
"is-reference": "3.0.3",
|
|
23946
|
+
"locate-character": "3.0.0",
|
|
23947
|
+
"magic-string": "0.30.21",
|
|
23948
|
+
"oxc-parser": "0.140.0",
|
|
23949
|
+
"oxc-walker": "1.1.1",
|
|
23950
|
+
"svelte": "5.55.1",
|
|
23951
|
+
"zimmerframe": "1.1.5"
|
|
23952
|
+
}
|
|
23895
23953
|
};
|
|
23896
23954
|
//#endregion
|
|
23897
23955
|
//#region ../../node_modules/.pnpm/effect@4.0.0-rc.112/node_modules/effect/dist/internal/schema/annotations.js
|
|
@@ -25065,7 +25123,7 @@ function omit() {
|
|
|
25065
25123
|
*/
|
|
25066
25124
|
function withDefault$3(defaultValue) {
|
|
25067
25125
|
return new Getter((o) => {
|
|
25068
|
-
const filtered = filter$
|
|
25126
|
+
const filtered = filter$2(o, isNotUndefined);
|
|
25069
25127
|
return isSome(filtered) ? succeed$4(filtered) : mapEager(defaultValue, some);
|
|
25070
25128
|
});
|
|
25071
25129
|
}
|
|
@@ -25190,7 +25248,7 @@ const BigDecimalProto = {
|
|
|
25190
25248
|
[TypeId$24]: TypeId$24,
|
|
25191
25249
|
[symbol$2]() {
|
|
25192
25250
|
const normalized = normalize(this);
|
|
25193
|
-
return combine$
|
|
25251
|
+
return combine$3(hash(normalized.value), number$2(normalized.scale));
|
|
25194
25252
|
},
|
|
25195
25253
|
[symbol$1](that) {
|
|
25196
25254
|
return isBigDecimal(that) && equals(this, that);
|
|
@@ -30324,7 +30382,7 @@ globalThis.RegExp;
|
|
|
30324
30382
|
* @category transforming
|
|
30325
30383
|
* @since 2.0.0
|
|
30326
30384
|
*/
|
|
30327
|
-
const escape
|
|
30385
|
+
const escape = (string) => string.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
30328
30386
|
//#endregion
|
|
30329
30387
|
//#region ../../node_modules/.pnpm/effect@4.0.0-rc.112/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
|
|
30330
30388
|
const jsonSchemaAnnotationExcludedKeys = /*#__PURE__*/ new Set([
|
|
@@ -30780,7 +30838,7 @@ function collectPatterns(schema) {
|
|
|
30780
30838
|
}
|
|
30781
30839
|
function getPartPattern(part) {
|
|
30782
30840
|
switch (part._tag) {
|
|
30783
|
-
case "Literal": return escape
|
|
30841
|
+
case "Literal": return escape(globalThis.String(part.literal));
|
|
30784
30842
|
case "String": return STRING_PATTERN;
|
|
30785
30843
|
case "Number": return FINITE_PATTERN;
|
|
30786
30844
|
case "TemplateLiteral": return part.parts.map(getPartPattern).join("");
|
|
@@ -31468,7 +31526,7 @@ function toStandardSchemaV1(self, options) {
|
|
|
31468
31526
|
const formatter = makeFormatterStandardSchemaV1(options);
|
|
31469
31527
|
const validate = (value) => {
|
|
31470
31528
|
const scheduler = new MixedScheduler("sync");
|
|
31471
|
-
const fiber = runFork(match
|
|
31529
|
+
const fiber = runFork(match(decodeUnknownEffect(value, parseOptions), {
|
|
31472
31530
|
onFailure: formatter,
|
|
31473
31531
|
onSuccess: (value) => ({ value })
|
|
31474
31532
|
}), { scheduler });
|
|
@@ -32653,7 +32711,7 @@ function isPattern(regExp, annotations) {
|
|
|
32653
32711
|
*/
|
|
32654
32712
|
function isStartsWith(startsWith, annotations) {
|
|
32655
32713
|
const formatted = JSON.stringify(startsWith);
|
|
32656
|
-
const regExp = new globalThis.RegExp(`^${escape
|
|
32714
|
+
const regExp = new globalThis.RegExp(`^${escape(startsWith)}`);
|
|
32657
32715
|
return makeFilter((s) => s.startsWith(startsWith), {
|
|
32658
32716
|
expected: `a string starting with ${formatted}`,
|
|
32659
32717
|
representation: {
|
|
@@ -33979,7 +34037,7 @@ const layer$10 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ f
|
|
|
33979
34037
|
}
|
|
33980
34038
|
return queue;
|
|
33981
34039
|
});
|
|
33982
|
-
const readLine = suspend$3(() => poll(lines).pipe(flatMap$1(match$
|
|
34040
|
+
const readLine = suspend$3(() => poll(lines).pipe(flatMap$1(match$6({
|
|
33983
34041
|
onNone: () => scoped(andThen$2(get$5(rlRef), take(lines))),
|
|
33984
34042
|
onSome: succeed$4
|
|
33985
34043
|
})), mapError(() => new QuitError({}))));
|
|
@@ -34885,7 +34943,7 @@ function normalizeFileName$4(fileName) {
|
|
|
34885
34943
|
return fileName.replace(/\\/g, "/");
|
|
34886
34944
|
}
|
|
34887
34945
|
const hasText = (value) => isString(value) && value.length > 0;
|
|
34888
|
-
const textIfNonEmpty = (value) => getOrUndefined$1(filter$
|
|
34946
|
+
const textIfNonEmpty = (value) => getOrUndefined$1(filter$2(fromUndefinedOr(value), hasText));
|
|
34889
34947
|
const fieldOf$1 = (value$35, key) => value(key in value$35).pipe(when(true, () => {
|
|
34890
34948
|
return Reflect.get(value$35, key);
|
|
34891
34949
|
}), orElse(() => void 0));
|
|
@@ -37772,10 +37830,20 @@ const WarningOptions = openStruct({
|
|
|
37772
37830
|
const ConcurrencyCount = Finite.pipe(check(isGreaterThanOrEqualTo(1)));
|
|
37773
37831
|
const ConcurrencyPercent = String$1.pipe(check(isPattern(/^(100|[1-9]?[0-9])%$/)));
|
|
37774
37832
|
const PluginFileUrl = String$1.pipe(check(isStartsWith("file://")));
|
|
37833
|
+
const TestRunnerConfigSchema = Union([String$1, Struct({
|
|
37834
|
+
plugin: PluginFileUrl,
|
|
37835
|
+
nodeArgs: optional$4(ArraySchema(String$1)),
|
|
37836
|
+
options: optional$4(Record(String$1, Unknown))
|
|
37837
|
+
})]);
|
|
37838
|
+
const CheckerEntryConfigSchema = Struct({
|
|
37839
|
+
plugin: PluginFileUrl,
|
|
37840
|
+
nodeArgs: optional$4(ArraySchema(String$1)),
|
|
37841
|
+
options: optional$4(Record(String$1, Unknown))
|
|
37842
|
+
});
|
|
37775
37843
|
const StrykerOptionsSchema = StructWithRest(Struct({
|
|
37776
37844
|
allowConsoleColors: defaulted(Boolean$2, true),
|
|
37777
37845
|
buildCommand: optional$4(String$1),
|
|
37778
|
-
checkers: defaulted(ArraySchema(
|
|
37846
|
+
checkers: defaulted(ArraySchema(CheckerEntryConfigSchema), []),
|
|
37779
37847
|
checkerNodeArgs: defaulted(ArraySchema(String$1), []),
|
|
37780
37848
|
concurrency: optional$4(Union([ConcurrencyCount, ConcurrencyPercent])),
|
|
37781
37849
|
commandRunner: defaulted(CommandRunnerOptionsSchema, { command: "npm test" }),
|
|
@@ -37822,7 +37890,7 @@ const StrykerOptionsSchema = StructWithRest(Struct({
|
|
|
37822
37890
|
false,
|
|
37823
37891
|
true
|
|
37824
37892
|
]), true),
|
|
37825
|
-
testRunner: defaulted(
|
|
37893
|
+
testRunner: defaulted(TestRunnerConfigSchema, "command"),
|
|
37826
37894
|
testRunnerNodeArgs: defaulted(ArraySchema(String$1), []),
|
|
37827
37895
|
thresholds: defaulted(MutationScoreThresholdsSchema, {
|
|
37828
37896
|
high: 80,
|
|
@@ -37836,9 +37904,10 @@ const StrykerOptionsSchema = StructWithRest(Struct({
|
|
|
37836
37904
|
warnings: defaulted(Union([Boolean$2, WarningOptions]), true),
|
|
37837
37905
|
disableBail: defaulted(Boolean$2, false),
|
|
37838
37906
|
allowEmpty: defaulted(Boolean$2, false),
|
|
37839
|
-
ignorers: defaulted(ArraySchema(
|
|
37907
|
+
ignorers: defaulted(ArraySchema(PluginFileUrl), []),
|
|
37840
37908
|
testFiles: defaulted(ArraySchema(String$1), [])
|
|
37841
37909
|
}), [Record(String$1, Unknown)]);
|
|
37910
|
+
const isCustomTestRunner = (value) => typeof value !== "string";
|
|
37842
37911
|
/**
|
|
37843
37912
|
* The four option defaults a human reads about in help text.
|
|
37844
37913
|
*
|
|
@@ -37868,7 +37937,7 @@ function toMutantRunResult(dryRunResult, reportAllKillers) {
|
|
|
37868
37937
|
return value(dryRunResult).pipe(discriminator("status")("complete", (complete) => {
|
|
37869
37938
|
const failed = complete.tests.filter((t) => t.status === "failed");
|
|
37870
37939
|
const nrOfTests = complete.tests.filter((t) => t.status !== "skipped").length;
|
|
37871
|
-
return match$
|
|
37940
|
+
return match$6(fromUndefinedOr(failed.at(0)), {
|
|
37872
37941
|
onNone: () => ({
|
|
37873
37942
|
nrOfTests,
|
|
37874
37943
|
status: "survived"
|
|
@@ -37883,7 +37952,7 @@ function toMutantRunResult(dryRunResult, reportAllKillers) {
|
|
|
37883
37952
|
}), discriminator("status")("error", (errored) => ({
|
|
37884
37953
|
errorMessage: errored.errorMessage,
|
|
37885
37954
|
status: "error"
|
|
37886
|
-
})), discriminator("status")("timeout", (timedOut) => match$
|
|
37955
|
+
})), discriminator("status")("timeout", (timedOut) => match$6(fromUndefinedOr(timedOut.reason), {
|
|
37887
37956
|
onNone: () => ({ status: "timeout" }),
|
|
37888
37957
|
onSome: (reason) => ({
|
|
37889
37958
|
reason,
|
|
@@ -38786,7 +38855,7 @@ const cyanBright = `${ESC}96m`;
|
|
|
38786
38855
|
const annotate = (text, ...styles) => {
|
|
38787
38856
|
return `${styles.flat().join("")}${text}${reset$1}`;
|
|
38788
38857
|
};
|
|
38789
|
-
const combine$
|
|
38858
|
+
const combine$2 = (...styles) => styles;
|
|
38790
38859
|
/** @internal */
|
|
38791
38860
|
const cursorTo = (column, row) => {
|
|
38792
38861
|
if (row === void 0) return `${ESC}${Math.max(column + 1, 0)}G`;
|
|
@@ -38880,7 +38949,7 @@ const getTheme = (options) => map$7(Theme, (theme) => ({
|
|
|
38880
38949
|
...options.theme
|
|
38881
38950
|
}));
|
|
38882
38951
|
const annotateLine = (line) => annotate(line, bold);
|
|
38883
|
-
const annotateErrorLine = (line, color) => annotate(line, combine$
|
|
38952
|
+
const annotateErrorLine = (line, color) => annotate(line, combine$2(italicized, color));
|
|
38884
38953
|
const annotateSymbol = (symbol, ...styles) => symbol.length === 0 ? "" : annotate(symbol, ...styles);
|
|
38885
38954
|
const separateSymbol = (symbol, text) => symbol.length === 0 ? text : symbol + " " + text;
|
|
38886
38955
|
const renderPagingPrefix = (theme, showArrowUp, showArrowDown) => {
|
|
@@ -39271,7 +39340,7 @@ const eraseText = (text, columns) => {
|
|
|
39271
39340
|
};
|
|
39272
39341
|
const lines = (prompt, columns) => {
|
|
39273
39342
|
const lines = prompt.split(NEWLINE_REGEXP);
|
|
39274
|
-
return columns === 0 ? lines.length : pipe(map$10(lines, (line) => Math.ceil(line.length / columns)), reduce$
|
|
39343
|
+
return columns === 0 ? lines.length : pipe(map$10(lines, (line) => Math.ceil(line.length / columns)), reduce$4(0, (left, right) => left + right));
|
|
39275
39344
|
};
|
|
39276
39345
|
const clearOutputWithError = (outputText, columns, errorText) => {
|
|
39277
39346
|
if (errorText !== void 0 && errorText.length > 0) return cursorDown(lines(errorText, columns)) + eraseText(`\n${errorText}`, columns) + eraseText(outputText, columns);
|
|
@@ -39328,9 +39397,9 @@ const handleDateClear = (options) => {
|
|
|
39328
39397
|
const columns = yield* (yield* Terminal).columns;
|
|
39329
39398
|
const figures = yield* getTheme(options);
|
|
39330
39399
|
const resetCurrentLine = eraseLine + cursorLeft;
|
|
39331
|
-
const parts = reduce$
|
|
39400
|
+
const parts = reduce$4(state.dateParts, "", (doc, part) => doc + part.toString());
|
|
39332
39401
|
const promptText = renderDateOutput(figures.prefix, figures.pointerSmall, parts, options, { plain: true });
|
|
39333
|
-
const errorText = isSome(state.error) ? match$
|
|
39402
|
+
const errorText = isSome(state.error) ? match$4(state.error.value.split(NEWLINE_REGEXP), {
|
|
39334
39403
|
onEmpty: () => "",
|
|
39335
39404
|
onNonEmpty: (errorLines) => separateSymbol(figures.pointerSmall, errorLines.join("\n"))
|
|
39336
39405
|
}) : "";
|
|
@@ -39349,10 +39418,10 @@ const renderDateError = (state, pointer, theme) => {
|
|
|
39349
39418
|
return "";
|
|
39350
39419
|
};
|
|
39351
39420
|
const renderParts = (state, theme, submitted = false) => {
|
|
39352
|
-
return reduce$
|
|
39421
|
+
return reduce$4(state.dateParts, "", (doc, part, currentIndex) => {
|
|
39353
39422
|
const partDoc = part.toString();
|
|
39354
39423
|
if (currentIndex === state.cursor && !submitted) {
|
|
39355
|
-
const annotation = combine$
|
|
39424
|
+
const annotation = combine$2(underlined, theme.primaryColor);
|
|
39356
39425
|
return doc + annotate(partDoc, annotation);
|
|
39357
39426
|
}
|
|
39358
39427
|
return doc + partDoc;
|
|
@@ -39409,7 +39478,7 @@ const processDateCursorRight = (state) => {
|
|
|
39409
39478
|
};
|
|
39410
39479
|
const processDateNext = (state) => {
|
|
39411
39480
|
const next = state.dateParts[state.cursor].nextPart();
|
|
39412
|
-
const cursor = match$
|
|
39481
|
+
const cursor = match$6(next, {
|
|
39413
39482
|
onNone: () => state.dateParts.findIndex((part) => !part.isToken()),
|
|
39414
39483
|
onSome: (next) => state.dateParts.indexOf(next)
|
|
39415
39484
|
});
|
|
@@ -39497,7 +39566,7 @@ const handleDateProcess = (options) => {
|
|
|
39497
39566
|
case "down": return succeed$4(processDown(state));
|
|
39498
39567
|
case "tab": return succeed$4(processDateNext(state));
|
|
39499
39568
|
case "enter":
|
|
39500
|
-
case "return": return match
|
|
39569
|
+
case "return": return match(options.validate(state.value), {
|
|
39501
39570
|
onFailure: (error) => Action.NextFrame({ state: {
|
|
39502
39571
|
...state,
|
|
39503
39572
|
error: some(error)
|
|
@@ -39752,7 +39821,7 @@ const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, options)
|
|
|
39752
39821
|
return output;
|
|
39753
39822
|
};
|
|
39754
39823
|
const annotate = options?.plain === true ? (line) => line : annotateLine;
|
|
39755
|
-
return match$
|
|
39824
|
+
return match$4(message.split(NEWLINE_REGEXP), {
|
|
39756
39825
|
onEmpty: () => renderLine(""),
|
|
39757
39826
|
onNonEmpty: (promptLines) => {
|
|
39758
39827
|
const lines = map$10(promptLines, (line) => annotate(line));
|
|
@@ -39780,11 +39849,11 @@ const handleNumberClear = (options) => {
|
|
|
39780
39849
|
const renderNumberInput = (state, submitted, theme, renderOptions) => {
|
|
39781
39850
|
const value = state.value === "" ? "" : `${state.value}`;
|
|
39782
39851
|
if (submitted || renderOptions?.plain === true) return value;
|
|
39783
|
-
const annotation = isSome(state.error) ? theme.errorColor : combine$
|
|
39852
|
+
const annotation = isSome(state.error) ? theme.errorColor : combine$2(underlined, theme.primaryColor);
|
|
39784
39853
|
return annotate(value, annotation);
|
|
39785
39854
|
};
|
|
39786
39855
|
const renderNumberError = (state, pointer, theme, renderOptions) => {
|
|
39787
|
-
if (isSome(state.error)) return match$
|
|
39856
|
+
if (isSome(state.error)) return match$4(state.error.value.split(NEWLINE_REGEXP), {
|
|
39788
39857
|
onEmpty: () => "",
|
|
39789
39858
|
onNonEmpty: (errorLines) => {
|
|
39790
39859
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
@@ -39889,7 +39958,7 @@ const handleProcessInteger = (options) => {
|
|
|
39889
39958
|
...state,
|
|
39890
39959
|
error: some("Must provide an integer value")
|
|
39891
39960
|
} }));
|
|
39892
|
-
else return match
|
|
39961
|
+
else return match(options.validate(parsed), {
|
|
39893
39962
|
onFailure: (error) => Action.NextFrame({ state: {
|
|
39894
39963
|
...state,
|
|
39895
39964
|
error: some(error)
|
|
@@ -39934,7 +40003,7 @@ const handleProcessFloat = (options) => {
|
|
|
39934
40003
|
...state,
|
|
39935
40004
|
error: some("Must provide a floating point value")
|
|
39936
40005
|
} }));
|
|
39937
|
-
else return flatMap$1(sync(() => round(parsed, options.precision)), (rounded) => match
|
|
40006
|
+
else return flatMap$1(sync(() => round(parsed, options.precision)), (rounded) => match(options.validate(rounded), {
|
|
39938
40007
|
onFailure: (error) => Action.NextFrame({ state: {
|
|
39939
40008
|
...state,
|
|
39940
40009
|
error: some(error)
|
|
@@ -39951,7 +40020,7 @@ const renderChoicePrefix = (state, choices, toDisplay, currentIndex, figures, re
|
|
|
39951
40020
|
const prefix = renderPagingPrefix(figures, currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0, currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < choices.length);
|
|
39952
40021
|
if (renderOptions?.plain === true) return state === currentIndex ? figures.pointer + prefix : prefix + " ".repeat(figures.pointer.length);
|
|
39953
40022
|
if (choices[currentIndex].disabled) {
|
|
39954
|
-
const annotation = combine$
|
|
40023
|
+
const annotation = combine$2(bold, figures.mutedColor);
|
|
39955
40024
|
return state === currentIndex ? annotateSymbol(figures.pointer, annotation) + prefix : prefix + " ".repeat(figures.pointer.length);
|
|
39956
40025
|
}
|
|
39957
40026
|
return state === currentIndex ? annotateSymbol(figures.pointer, figures.primaryColor) + prefix : prefix + " ".repeat(figures.pointer.length);
|
|
@@ -39959,8 +40028,8 @@ const renderChoicePrefix = (state, choices, toDisplay, currentIndex, figures, re
|
|
|
39959
40028
|
const renderChoiceTitle = (choice, isSelected, theme, renderOptions) => {
|
|
39960
40029
|
if (renderOptions?.plain === true) return choice.title;
|
|
39961
40030
|
const title = choice.title;
|
|
39962
|
-
if (isSelected) return choice.disabled ? annotate(title, combine$
|
|
39963
|
-
return choice.disabled ? annotate(title, combine$
|
|
40031
|
+
if (isSelected) return choice.disabled ? annotate(title, combine$2(underlined, theme.mutedColor)) : annotate(title, combine$2(underlined, theme.primaryColor));
|
|
40032
|
+
return choice.disabled ? annotate(title, combine$2(strikethrough, theme.mutedColor)) : title;
|
|
39964
40033
|
};
|
|
39965
40034
|
const renderSelectChoices = (state, options, figures, renderOptions) => {
|
|
39966
40035
|
const choices = options.choices;
|
|
@@ -40052,7 +40121,7 @@ const renderTextInput = (nextState, options, theme, submitted, renderOptions) =>
|
|
|
40052
40121
|
case "text": return text;
|
|
40053
40122
|
}
|
|
40054
40123
|
if (text.length === 0) return "";
|
|
40055
|
-
const annotation = isSome(nextState.error) ? theme.errorColor : submitted ? theme.submittedColor : combine$
|
|
40124
|
+
const annotation = isSome(nextState.error) ? theme.errorColor : submitted ? theme.submittedColor : combine$2(underlined, theme.primaryColor);
|
|
40056
40125
|
switch (options.type) {
|
|
40057
40126
|
case "hidden": return "";
|
|
40058
40127
|
case "password": return annotateSymbol(theme.passwordMask.repeat(text.length), annotation);
|
|
@@ -40060,7 +40129,7 @@ const renderTextInput = (nextState, options, theme, submitted, renderOptions) =>
|
|
|
40060
40129
|
}
|
|
40061
40130
|
};
|
|
40062
40131
|
const renderTextError = (nextState, pointer, theme, renderOptions) => {
|
|
40063
|
-
if (isSome(nextState.error)) return match$
|
|
40132
|
+
if (isSome(nextState.error)) return match$4(nextState.error.value.split(NEWLINE_REGEXP), {
|
|
40064
40133
|
onEmpty: () => "",
|
|
40065
40134
|
onNonEmpty: (errorLines) => {
|
|
40066
40135
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
@@ -40184,7 +40253,7 @@ const handleTextProcess = (options) => {
|
|
|
40184
40253
|
case "enter":
|
|
40185
40254
|
case "return": {
|
|
40186
40255
|
const value = state.value;
|
|
40187
|
-
return match
|
|
40256
|
+
return match(options.validate(value), {
|
|
40188
40257
|
onFailure: (error) => Action.NextFrame({ state: {
|
|
40189
40258
|
...state,
|
|
40190
40259
|
value,
|
|
@@ -40231,7 +40300,7 @@ const handleToggleClear = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
40231
40300
|
});
|
|
40232
40301
|
const renderToggle = (value, options, theme, submitted = false) => {
|
|
40233
40302
|
const separator = annotateSymbol(theme.toggleSeparator, theme.mutedColor);
|
|
40234
|
-
const selectedAnnotation = combine$
|
|
40303
|
+
const selectedAnnotation = combine$2(underlined, submitted ? theme.submittedColor : theme.primaryColor);
|
|
40235
40304
|
const inactive = value ? options.inactive : annotate(options.inactive, selectedAnnotation);
|
|
40236
40305
|
return (value ? annotate(options.active, selectedAnnotation) : options.active) + " " + separateSymbol(separator, inactive);
|
|
40237
40306
|
};
|
|
@@ -40775,7 +40844,7 @@ const optional$3 = (param) => {
|
|
|
40775
40844
|
*/
|
|
40776
40845
|
const withDefault$1 = /*#__PURE__*/ dual(2, (self, defaultValue) => {
|
|
40777
40846
|
if (!isEffect(defaultValue)) return map$2(optional$3(self), getOrElse(() => defaultValue));
|
|
40778
|
-
return mapEffect(optional$3(self), match$
|
|
40847
|
+
return mapEffect(optional$3(self), match$6({
|
|
40779
40848
|
onNone: () => defaultValue,
|
|
40780
40849
|
onSome: succeed$4
|
|
40781
40850
|
}));
|
|
@@ -42492,7 +42561,7 @@ const toFlagDoc = (single, metadata) => {
|
|
|
42492
42561
|
const appendChoiceKeys = (description, choiceKeys) => {
|
|
42493
42562
|
if (choiceKeys === void 0 || choiceKeys.length === 0) return description;
|
|
42494
42563
|
const choiceSuffix = `(choices: ${choiceKeys.join(", ")})`;
|
|
42495
|
-
return match$
|
|
42564
|
+
return match$6(description, {
|
|
42496
42565
|
onNone: () => some(choiceSuffix),
|
|
42497
42566
|
onSome: (value) => some(`${value} ${choiceSuffix}`)
|
|
42498
42567
|
});
|
|
@@ -42956,14 +43025,14 @@ const BuiltIns = [
|
|
|
42956
43025
|
* @category services
|
|
42957
43026
|
* @since 4.0.0
|
|
42958
43027
|
*/
|
|
42959
|
-
var CliConfig = class extends (/*#__PURE__*/ Reference("effect/unstable/cli/CliConfig", { defaultValue: () => defaults
|
|
43028
|
+
var CliConfig = class extends (/*#__PURE__*/ Reference("effect/unstable/cli/CliConfig", { defaultValue: () => defaults })) {};
|
|
42960
43029
|
/**
|
|
42961
43030
|
* Default CLI configuration containing every built-in global flag.
|
|
42962
43031
|
*
|
|
42963
43032
|
* @category defaults
|
|
42964
43033
|
* @since 4.0.0
|
|
42965
43034
|
*/
|
|
42966
|
-
const defaults
|
|
43035
|
+
const defaults = { builtIns: BuiltIns };
|
|
42967
43036
|
/**
|
|
42968
43037
|
* Creates CLI configuration by merging the provided options over `defaults`.
|
|
42969
43038
|
*
|
|
@@ -42978,7 +43047,7 @@ const defaults$1 = { builtIns: BuiltIns };
|
|
|
42978
43047
|
* @since 4.0.0
|
|
42979
43048
|
*/
|
|
42980
43049
|
const make$8 = (options) => ({
|
|
42981
|
-
...defaults
|
|
43050
|
+
...defaults,
|
|
42982
43051
|
...options
|
|
42983
43052
|
});
|
|
42984
43053
|
/**
|
|
@@ -43110,7 +43179,7 @@ const suggest = (input, candidates) => {
|
|
|
43110
43179
|
* - Errors accumulate rather than throwing exceptions
|
|
43111
43180
|
*/
|
|
43112
43181
|
/** @internal */
|
|
43113
|
-
const getCommandPath = (parsedInput) => match$
|
|
43182
|
+
const getCommandPath = (parsedInput) => match$6(parsedInput.subcommand, {
|
|
43114
43183
|
onNone: () => [],
|
|
43115
43184
|
onSome: (subcommand) => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]
|
|
43116
43185
|
});
|
|
@@ -44278,7 +44347,7 @@ const runWith = (command, config) => {
|
|
|
44278
44347
|
const [, value] = yield* flag.flag.parse(emptyArgs);
|
|
44279
44348
|
program = provideService(program, flag, value);
|
|
44280
44349
|
}
|
|
44281
|
-
const services = match$
|
|
44350
|
+
const services = match$6(logLevel, {
|
|
44282
44351
|
onNone: () => empty$12(),
|
|
44283
44352
|
onSome: (level) => make$42(MinimumLogLevel, level)
|
|
44284
44353
|
});
|
|
@@ -44371,7 +44440,7 @@ const make$6 = (run) => ({
|
|
|
44371
44440
|
const layerRunner = (spec) => {
|
|
44372
44441
|
if ("decode" in spec && "encode" in spec) return (input) => gen(function* () {
|
|
44373
44442
|
const raw = yield* spec.read(input);
|
|
44374
|
-
const decoded = yield* match$
|
|
44443
|
+
const decoded = yield* match$5(spec.decode(raw), {
|
|
44375
44444
|
onFailure: fail,
|
|
44376
44445
|
onSuccess: succeed$4
|
|
44377
44446
|
});
|
|
@@ -44409,7 +44478,7 @@ const zip = dual(2, (self, that) => make$6((input) => zipWith(self.run(input), t
|
|
|
44409
44478
|
* Runs the inner Cell on the value this Cell read, yielding `Option.none` when it read none.
|
|
44410
44479
|
* A skip is an absence, never a refusal; the error and service channels union.
|
|
44411
44480
|
*/
|
|
44412
|
-
const gate = dual(2, (self, inner) => make$6((input) => flatMap$1(self.run(input), (read) => match$
|
|
44481
|
+
const gate = dual(2, (self, inner) => make$6((input) => flatMap$1(self.run(input), (read) => match$6(read, {
|
|
44413
44482
|
onNone: () => succeed$4(none()),
|
|
44414
44483
|
onSome: (raw) => map$7(inner.run(raw), some)
|
|
44415
44484
|
}))));
|
|
@@ -44636,7 +44705,7 @@ const isSucceeded = (command) => command.succeeded;
|
|
|
44636
44705
|
const isHelpRun = (command) => command.helpErrorCount !== void 0;
|
|
44637
44706
|
const isSurvivorsRun = (command) => command.survivorsReason !== void 0;
|
|
44638
44707
|
const isHighestClassed = (command) => command.highestExitClass !== void 0;
|
|
44639
|
-
const succeededOutcome = (command) => match$
|
|
44708
|
+
const succeededOutcome = (command) => match$6(fromUndefinedOr(command.successExitClass), {
|
|
44640
44709
|
onNone: () => RunOk.make({ help: false }),
|
|
44641
44710
|
onSome: (exitClass) => RunFailed$1.make({
|
|
44642
44711
|
code: classCode(exitClass),
|
|
@@ -44682,7 +44751,7 @@ function parseConcurrency(value) {
|
|
|
44682
44751
|
return value;
|
|
44683
44752
|
}
|
|
44684
44753
|
const optional = (option) => optional$1(option);
|
|
44685
|
-
const absentWhenFalse = (value) => getOrUndefined$1(filter$
|
|
44754
|
+
const absentWhenFalse = (value) => getOrUndefined$1(filter$2(value, (present) => present));
|
|
44686
44755
|
const isUnknownArgument = (argument) => exists$1(fromUndefinedOr(argument), (text) => text.startsWith("-"));
|
|
44687
44756
|
function unwrap(value) {
|
|
44688
44757
|
if (isOption(value)) return getOrUndefined$1(value);
|
|
@@ -44736,6 +44805,27 @@ TaggedClass()("MergeCommand", {
|
|
|
44736
44805
|
overrides: Record(String$1, Unknown)
|
|
44737
44806
|
});
|
|
44738
44807
|
TaggedClass()("MergeResult", { merged: Record(String$1, Unknown) });
|
|
44808
|
+
const ExtendsStepDocumentSchema = Struct({
|
|
44809
|
+
path: String$1,
|
|
44810
|
+
options: ConfigDocumentSchema
|
|
44811
|
+
});
|
|
44812
|
+
const ExtendsStepStateSchema = Struct({
|
|
44813
|
+
visited: ArraySchema(String$1),
|
|
44814
|
+
documents: ArraySchema(ExtendsStepDocumentSchema)
|
|
44815
|
+
});
|
|
44816
|
+
var ExtendsStepDone = class extends TaggedClass()("done", { options: ConfigDocumentSchema }) {};
|
|
44817
|
+
var ExtendsStepRead = class extends TaggedClass()("read", {
|
|
44818
|
+
path: String$1,
|
|
44819
|
+
state: ExtendsStepStateSchema
|
|
44820
|
+
}) {};
|
|
44821
|
+
var ExtendsStepResolve = class extends TaggedClass()("resolve", {
|
|
44822
|
+
specifier: String$1,
|
|
44823
|
+
state: ExtendsStepStateSchema
|
|
44824
|
+
}) {};
|
|
44825
|
+
var ExtendsStepRefused = class extends TaggedClass()("refused", {
|
|
44826
|
+
reason: Literals(["cycle", "non-string-extends"]),
|
|
44827
|
+
file: String$1
|
|
44828
|
+
}) {};
|
|
44739
44829
|
const survivorsPriorReport = optionalKey(String$1.pipe(annotate$1({ description: "The path of the prior mutation report a --survivors run admits against and re-tests the survivors of. Defaults to \"reports/mutation-report.json\" when unset. Deliberately has no default: a default would be injected into every resolved options object and written into every report, poisoning the KTD7 marker that identifies a report produced by a survivors run." })));
|
|
44740
44830
|
const extendsPropertySchema = optionalKey(String$1.pipe(annotate$1({ description: "Path to another stryker config file whose options merge underneath this one. Resolved relative to this file. A child scalar or array replaces the inherited value; a child object merges one level deep; a child key set to null deletes the inherited key. Inheritance chains are not rewritten, so an inherited relative path value still resolves against the working directory of the run that reads it." })));
|
|
44741
44831
|
const forkOptionsSchema = StructWithRest(Struct({
|
|
@@ -44752,13 +44842,13 @@ const EXIT_CODE = {
|
|
|
44752
44842
|
InternalError: 4
|
|
44753
44843
|
};
|
|
44754
44844
|
function verdictExitClass$1(score, breakingThreshold) {
|
|
44755
|
-
return match$
|
|
44845
|
+
return match$6(all$2([fromNullishOr(score), fromNullishOr(breakingThreshold)]), {
|
|
44756
44846
|
onNone: () => null,
|
|
44757
44847
|
onSome: ([actual, threshold]) => value(actual < threshold).pipe(when(true, () => "VerdictFail"), when(false, () => null), exhaustive)
|
|
44758
44848
|
});
|
|
44759
44849
|
}
|
|
44760
44850
|
function highestExitClass(pending) {
|
|
44761
|
-
return [...pending].reduce((highest, candidate) => match$
|
|
44851
|
+
return [...pending].reduce((highest, candidate) => match$6(fromNullishOr(highest), {
|
|
44762
44852
|
onNone: () => candidate,
|
|
44763
44853
|
onSome: (current) => value(EXIT_CODE[candidate] > EXIT_CODE[current]).pipe(when(true, () => candidate), when(false, () => current), exhaustive)
|
|
44764
44854
|
}), null);
|
|
@@ -44768,7 +44858,7 @@ function highestExitClass(pending) {
|
|
|
44768
44858
|
const CONFIG_CODE = 2;
|
|
44769
44859
|
const UNKNOWN_FAILURE = "Unknown failure";
|
|
44770
44860
|
function runOutcomeCode(result) {
|
|
44771
|
-
const outcome = match$
|
|
44861
|
+
const outcome = match$5(result, {
|
|
44772
44862
|
onSuccess: (success) => success,
|
|
44773
44863
|
onFailure: (failure) => failure
|
|
44774
44864
|
});
|
|
@@ -44831,7 +44921,7 @@ function collectExitClasses(exit) {
|
|
|
44831
44921
|
const nonEmptyText = liftPredicate(is$2(NonEmptyString));
|
|
44832
44922
|
function reasonOf(value$22) {
|
|
44833
44923
|
const declared = value(value$22).pipe(when(carriesReason, (carrier) => carrier.reason), orElse(() => void 0));
|
|
44834
|
-
return getOrUndefined$1(map$12(nonEmptyText(declared), (reason) => match$
|
|
44924
|
+
return getOrUndefined$1(map$12(nonEmptyText(declared), (reason) => match$6(fromNullishOr(causeTextOf(value$22)), {
|
|
44835
44925
|
onNone: () => reason,
|
|
44836
44926
|
onSome: (detail) => `${reason}: ${detail}`
|
|
44837
44927
|
})));
|
|
@@ -44886,7 +44976,7 @@ function argumentHintOf(error, argv) {
|
|
|
44886
44976
|
return value(error).pipe(tag("UnrecognizedOption", (unrecognized) => some(unrecognizedArgument(argv, unrecognized.option))), tag("UnexpectedArgument", (unexpected) => fromNullishOr(unexpected.arguments[0])), tag("UnknownSubcommand", (unknown) => some(unknown.subcommand)), orElse(() => none()));
|
|
44887
44977
|
}
|
|
44888
44978
|
function unrecognizedArgument(argv, option) {
|
|
44889
|
-
return followingArgument(argv, option).pipe(filter$
|
|
44979
|
+
return followingArgument(argv, option).pipe(filter$2((argument) => !argument.startsWith("-")), getOrElse(() => option));
|
|
44890
44980
|
}
|
|
44891
44981
|
function followingArgument(argv, option) {
|
|
44892
44982
|
return value(argv.indexOf(option)).pipe(when((at) => at >= 0, (at) => fromNullishOr(argv[at + 1])), orElse(() => none()));
|
|
@@ -45323,12 +45413,12 @@ var MissingPackages = class extends TaggedError()("MissingPackages", { packages:
|
|
|
45323
45413
|
const orDefault$1 = (present, fallback) => getOrElse(present, () => fallback);
|
|
45324
45414
|
const thresholdsOf = (part) => orDefault$1(map$12(fromUndefinedOr(part), (present) => present.report.thresholds), DEFAULT_THRESHOLDS);
|
|
45325
45415
|
const hasReport = (part) => part.report !== void 0;
|
|
45326
|
-
const scoreFor = (part) => getOrUndefined$1(map$12(filter$
|
|
45416
|
+
const scoreFor = (part) => getOrUndefined$1(map$12(filter$2(fromUndefinedOr(part), hasReport), (present) => scoreOf(present.report.files)));
|
|
45327
45417
|
const outcomeOf = (reports) => value(reports.some((part) => part.outcome === FAILING_OUTCOME)).pipe(when(true, () => FAILING_OUTCOME), when(false, () => PASSING_OUTCOME), exhaustive);
|
|
45328
45418
|
const normalizeName = (fileName) => fileName.split(SEGMENT_SEPARATORS).filter(Boolean).join("/");
|
|
45329
45419
|
const commonBasePath = (fileNames) => {
|
|
45330
45420
|
const directories = fileNames.map((fileName) => fileName.split(SEGMENT_SEPARATORS).slice(0, -1));
|
|
45331
|
-
return reduce$
|
|
45421
|
+
return reduce$4(directories, orDefault$1(head(directories), EMPTY_SEGMENTS), (left, right) => takeWhile(left, (segment, index) => right[index] === segment)).join("/");
|
|
45332
45422
|
};
|
|
45333
45423
|
const normalizedNames = (input) => {
|
|
45334
45424
|
const base = commonBasePath(Object.keys(input));
|
|
@@ -45342,7 +45432,7 @@ const rewrittenMutant = (label, mutant) => ({
|
|
|
45342
45432
|
killedBy: uniqueIds(label, mutant.killedBy),
|
|
45343
45433
|
coveredBy: uniqueIds(label, mutant.coveredBy)
|
|
45344
45434
|
});
|
|
45345
|
-
const withProjectRoot = (report, projectRoot) => match$
|
|
45435
|
+
const withProjectRoot = (report, projectRoot) => match$6(fromUndefinedOr(projectRoot), {
|
|
45346
45436
|
onNone: () => report,
|
|
45347
45437
|
onSome: (root) => ({
|
|
45348
45438
|
...report,
|
|
@@ -45418,7 +45508,7 @@ const scoredRow = (label, score, outcome) => value(Number.isNaN(score.mutationSc
|
|
|
45418
45508
|
cells: score.cells,
|
|
45419
45509
|
verdict: passingVerdict(score, outcome)
|
|
45420
45510
|
})), exhaustive);
|
|
45421
|
-
const completeRow = (label, score, outcome) => match$
|
|
45511
|
+
const completeRow = (label, score, outcome) => match$6(fromUndefinedOr(score), {
|
|
45422
45512
|
onNone: () => ({
|
|
45423
45513
|
label,
|
|
45424
45514
|
score: SCORE_ABSENT,
|
|
@@ -45434,7 +45524,7 @@ const verdictOf = (label, score, outcome, incomplete) => value(incomplete).pipe(
|
|
|
45434
45524
|
verdict: incompleteVerdict(outcome)
|
|
45435
45525
|
})), when(false, () => completeRow(label, score, outcome)), exhaustive);
|
|
45436
45526
|
/** The label a second part repeats, and `none` when it repeats none a report can name. */
|
|
45437
|
-
const repeatedLabel = (parts) => filter$
|
|
45527
|
+
const repeatedLabel = (parts) => filter$2(map$12(fromUndefinedOr(parts.find((part, index) => parts.slice(0, index).some((earlier) => earlier.label === part.label))), (duplicate) => duplicate.label), (label) => label !== "");
|
|
45438
45528
|
const uniqueParts = (parts) => parts.filter((part, index) => parts.slice(0, index).every((earlier) => earlier.label !== part.label));
|
|
45439
45529
|
const chooseReports = (parts) => parts.flatMap((part) => toArray(map$12(fromUndefinedOr(part.report), (report) => ({
|
|
45440
45530
|
...part,
|
|
@@ -45449,7 +45539,7 @@ const survivorsOf = (report) => Object.entries(report.files).flatMap(([file, fil
|
|
|
45449
45539
|
mutatorName: mutant.mutatorName,
|
|
45450
45540
|
replacement: orDefault$1(fromNullishOr(mutant.replacement), "")
|
|
45451
45541
|
}))).sort(byFileThenLine);
|
|
45452
|
-
const rowOf = (label, part) => match$
|
|
45542
|
+
const rowOf = (label, part) => match$6(fromUndefinedOr(part), {
|
|
45453
45543
|
onNone: () => verdictOf(label, void 0, void 0, false),
|
|
45454
45544
|
onSome: (present) => verdictOf(label, scoreFor(present), present.outcome, present.incomplete)
|
|
45455
45545
|
});
|
|
@@ -45476,7 +45566,7 @@ const decideMerge = (command) => {
|
|
|
45476
45566
|
const DuplicateLabelFound = TaggedStruct("DuplicateLabelFound", { label: String$1 });
|
|
45477
45567
|
const LabelsDistinct = TaggedStruct("LabelsDistinct", {});
|
|
45478
45568
|
Union([DuplicateLabelFound, LabelsDistinct]);
|
|
45479
|
-
const labelCheckOf = (parts) => match$
|
|
45569
|
+
const labelCheckOf = (parts) => match$6(repeatedLabel(parts), {
|
|
45480
45570
|
onNone: () => LabelsDistinct.make({}),
|
|
45481
45571
|
onSome: (label) => DuplicateLabelFound.make({ label })
|
|
45482
45572
|
});
|
|
@@ -45556,7 +45646,7 @@ const readMerge = (request) => gen(function* () {
|
|
|
45556
45646
|
yield* value(present).pipe(when(true, () => void_$1), when(false, () => failReason(`no such parts directory ${request.parts}`)), exhaustive);
|
|
45557
45647
|
const dirs = yield* collectPartDirs(request.parts);
|
|
45558
45648
|
const bytes = yield* forEach$1(dirs, readPartBytes);
|
|
45559
|
-
return yield* match$
|
|
45649
|
+
return yield* match$5(decodeMerge({
|
|
45560
45650
|
packagesRaw: request.packages,
|
|
45561
45651
|
bytes
|
|
45562
45652
|
}), {
|
|
@@ -45576,7 +45666,7 @@ const mutantFromStream = (line) => {
|
|
|
45576
45666
|
status: line.status,
|
|
45577
45667
|
location: line.location
|
|
45578
45668
|
};
|
|
45579
|
-
return match$
|
|
45669
|
+
return match$6(liftPredicate(line.replacement, (value) => typeof value === "string"), {
|
|
45580
45670
|
onNone: () => mutant,
|
|
45581
45671
|
onSome: (replacement) => ({
|
|
45582
45672
|
...mutant,
|
|
@@ -45606,7 +45696,7 @@ const reportFromStream = (text) => {
|
|
|
45606
45696
|
}]))
|
|
45607
45697
|
}));
|
|
45608
45698
|
};
|
|
45609
|
-
const decodedPart = (bytes) => match$
|
|
45699
|
+
const decodedPart = (bytes) => match$6(flatMap$5(fromNullishOr(bytes.metaText), decodeOption(fromJsonString(PartMetaSchema))), {
|
|
45610
45700
|
onNone: () => ({
|
|
45611
45701
|
part: none(),
|
|
45612
45702
|
unreadable: false
|
|
@@ -45617,8 +45707,8 @@ const decodedPart = (bytes) => match$7(flatMap$5(fromNullishOr(bytes.metaText),
|
|
|
45617
45707
|
outcome: meta.outcome,
|
|
45618
45708
|
incomplete: false
|
|
45619
45709
|
};
|
|
45620
|
-
return match$
|
|
45621
|
-
onSome: (text) => match$
|
|
45710
|
+
return match$6(fromNullishOr(bytes.reportText), {
|
|
45711
|
+
onSome: (text) => match$6(decodeOption(fromJsonString(MutationTestResultSchema$1))(text), {
|
|
45622
45712
|
onNone: () => ({
|
|
45623
45713
|
part: some(base),
|
|
45624
45714
|
unreadable: true
|
|
@@ -45631,7 +45721,7 @@ const decodedPart = (bytes) => match$7(flatMap$5(fromNullishOr(bytes.metaText),
|
|
|
45631
45721
|
unreadable: false
|
|
45632
45722
|
})
|
|
45633
45723
|
}),
|
|
45634
|
-
onNone: () => match$
|
|
45724
|
+
onNone: () => match$6(flatMap$5(fromNullishOr(bytes.streamText), reportFromStream), {
|
|
45635
45725
|
onNone: () => ({
|
|
45636
45726
|
part: some(base),
|
|
45637
45727
|
unreadable: false
|
|
@@ -45648,9 +45738,9 @@ const decodedPart = (bytes) => match$7(flatMap$5(fromNullishOr(bytes.metaText),
|
|
|
45648
45738
|
});
|
|
45649
45739
|
}
|
|
45650
45740
|
});
|
|
45651
|
-
const expectedPackages = (raw) => match$
|
|
45741
|
+
const expectedPackages = (raw) => match$6(filter$2(fromNullishOr(raw), is$2(NonEmptyString)), {
|
|
45652
45742
|
onNone: () => succeed$8(void 0),
|
|
45653
|
-
onSome: (text) => match$
|
|
45743
|
+
onSome: (text) => match$6(decodeOption(fromJsonString(ArraySchema(String$1)))(text), {
|
|
45654
45744
|
onNone: () => fail$4(refuse(`--packages is not a JSON array: ${text}`)),
|
|
45655
45745
|
onSome: (packages) => succeed$8(packages)
|
|
45656
45746
|
})
|
|
@@ -45665,7 +45755,7 @@ const decodeMerge = (raw) => map$11(expectedPackages(raw.packagesRaw), (packages
|
|
|
45665
45755
|
parts: reads.flatMap((read) => toArray(read.part)),
|
|
45666
45756
|
expectedPackages: packages
|
|
45667
45757
|
}),
|
|
45668
|
-
skipped: reads.flatMap((read) => match$
|
|
45758
|
+
skipped: reads.flatMap((read) => match$6(read.part, {
|
|
45669
45759
|
onNone: () => [read.dir],
|
|
45670
45760
|
onSome: () => []
|
|
45671
45761
|
})),
|
|
@@ -45716,7 +45806,7 @@ const encodeMerge = (outcome, decoded) => map$11(outcome, (decision) => value(de
|
|
|
45716
45806
|
const encodeReport = (report) => encodeEffect(fromJsonString(Unknown, { space: 2 }))(report).pipe(orDie);
|
|
45717
45807
|
const putFile = (file, content, append) => FileSystem.pipe(flatMap$1((fs) => value(append).pipe(when(true, () => fs.writeFileString(file, content, { flag: "a" })), when(false, () => fs.writeFileString(file, content)), exhaustive)), catchCause(() => failReason(`cannot write ${file}`)));
|
|
45718
45808
|
const toStream = (events) => toAsyncIterable(fromIterable$4([...events]));
|
|
45719
|
-
const writeHtml = (fileName, report) => match$
|
|
45809
|
+
const writeHtml = (fileName, report) => match$6(decodeOption(StrykerOptionsSchema)({ htmlReporter: { fileName } }), {
|
|
45720
45810
|
onNone: () => failReason(`cannot configure the html report at ${fileName}`),
|
|
45721
45811
|
onSome: (options) => gen(function* () {
|
|
45722
45812
|
const metrics = calculateMetrics(report.files);
|
|
@@ -45726,19 +45816,19 @@ const writeHtml = (fileName, report) => match$7(decodeOption(StrykerOptionsSchem
|
|
|
45726
45816
|
})])).pipe(catchCause(() => failReason(`cannot write the html report at ${fileName}`)));
|
|
45727
45817
|
})
|
|
45728
45818
|
});
|
|
45729
|
-
const writeEncoded = (document, raw) => match$
|
|
45819
|
+
const writeEncoded = (document, raw) => match$5(document, {
|
|
45730
45820
|
onFailure: (error) => failReason(refusalText(error, raw.partsDir)),
|
|
45731
45821
|
onSuccess: (body) => gen(function* () {
|
|
45732
45822
|
const fs = yield* FileSystem;
|
|
45733
45823
|
const path = yield* Path;
|
|
45734
45824
|
yield* fs.makeDirectory(raw.out, { recursive: true }).pipe(catchCause(() => failReason(`cannot create ${raw.out}`)));
|
|
45735
|
-
yield* match$
|
|
45825
|
+
yield* match$6(fromNullishOr(body.report), {
|
|
45736
45826
|
onNone: () => void_$1,
|
|
45737
45827
|
onSome: (report) => encodeReport(report).pipe(flatMap$1((json) => putFile(path.join(raw.out, OUT_REPORT), json, false).pipe(andThen$2(writeHtml(path.join(raw.out, OUT_HTML), report)))))
|
|
45738
45828
|
});
|
|
45739
45829
|
yield* putFile(path.join(raw.out, OUT_SUMMARY), body.summary, false);
|
|
45740
45830
|
const step = yield* string$4(STEP_SUMMARY).pipe(option$1);
|
|
45741
|
-
yield* match$
|
|
45831
|
+
yield* match$6(step, {
|
|
45742
45832
|
onNone: () => void_$1,
|
|
45743
45833
|
onSome: (file) => value(file.length > 0).pipe(when(true, () => putFile(file, body.summary, true)), when(false, () => void_$1), exhaustive)
|
|
45744
45834
|
});
|
|
@@ -45832,7 +45922,7 @@ var MachineOutput = class extends TaggedClass()("MachineOutput", {
|
|
|
45832
45922
|
[ResolveModeTypeId] = ResolveModeTypeId;
|
|
45833
45923
|
};
|
|
45834
45924
|
const CONFLICT_EXPECTED = "the \"--format text\" and \"--json\" flags are mutually exclusive — use one or the other";
|
|
45835
|
-
const configured = (value) => filter$
|
|
45925
|
+
const configured = (value) => filter$2(fromNullishOr(value), is$2(NonEmptyString));
|
|
45836
45926
|
const modeFromEnv = (envMode, stdoutIsTTY) => value(envMode).pipe(when("machine", () => MachineOutput.make({
|
|
45837
45927
|
signal: "env",
|
|
45838
45928
|
stdoutIsTTY
|
|
@@ -45840,7 +45930,7 @@ const modeFromEnv = (envMode, stdoutIsTTY) => value(envMode).pipe(when("machine"
|
|
|
45840
45930
|
signal: "env",
|
|
45841
45931
|
stdoutIsTTY
|
|
45842
45932
|
})));
|
|
45843
|
-
const modeFromAgent = (command) => match$
|
|
45933
|
+
const modeFromAgent = (command) => match$6(configured(command.agent), {
|
|
45844
45934
|
onNone: () => modeFromTools(command),
|
|
45845
45935
|
onSome: () => MachineOutput.make({
|
|
45846
45936
|
signal: "agent",
|
|
@@ -45854,7 +45944,7 @@ const modeFromTools = (command) => value(anyToolVariableSet(command.toolVars)).p
|
|
|
45854
45944
|
signal: "tty",
|
|
45855
45945
|
stdoutIsTTY: true
|
|
45856
45946
|
})));
|
|
45857
|
-
const anyToolVariableSet = (toolVars) => match$
|
|
45947
|
+
const anyToolVariableSet = (toolVars) => match$6(fromNullishOr(toolVars), {
|
|
45858
45948
|
onNone: () => false,
|
|
45859
45949
|
onSome: (named) => TOOL_VARIABLES$1.some((variable) => isSome(configured(named[variable])))
|
|
45860
45950
|
});
|
|
@@ -45862,7 +45952,7 @@ const modeBelowEnv = (command) => value(command.stdoutIsTTY).pipe(when(false, ()
|
|
|
45862
45952
|
signal: "tty",
|
|
45863
45953
|
stdoutIsTTY: false
|
|
45864
45954
|
})), orElse(() => modeFromAgent(command)));
|
|
45865
|
-
const modeFromEnvironment = (command) => match$
|
|
45955
|
+
const modeFromEnvironment = (command) => match$6(configured(command.envMode), {
|
|
45866
45956
|
onNone: () => modeBelowEnv(command),
|
|
45867
45957
|
onSome: (envMode) => modeFromEnv(envMode, command.stdoutIsTTY)
|
|
45868
45958
|
});
|
|
@@ -46132,15 +46222,15 @@ const PreviousFilesSchema = Record(String$1, PreviousFileSchema);
|
|
|
46132
46222
|
const PreviousTestFilesSchema = Record(String$1, PreviousTestFileSchema);
|
|
46133
46223
|
const ZERO = 0;
|
|
46134
46224
|
const firstDefined = (first, second) => getOrElse(fromNullishOr(first), () => second);
|
|
46135
|
-
const staticField = (isStatic) => match$
|
|
46225
|
+
const staticField = (isStatic) => match$6(fromUndefinedOr(isStatic), {
|
|
46136
46226
|
onNone: () => ({}),
|
|
46137
46227
|
onSome: (present) => ({ static: present })
|
|
46138
46228
|
});
|
|
46139
|
-
const coveredByField = (coveredBy) => match$
|
|
46229
|
+
const coveredByField = (coveredBy) => match$6(fromUndefinedOr(coveredBy), {
|
|
46140
46230
|
onNone: () => ({}),
|
|
46141
46231
|
onSome: (present) => ({ coveredBy: [...present] })
|
|
46142
46232
|
});
|
|
46143
|
-
const testFilterField = (testFilter) => match$
|
|
46233
|
+
const testFilterField = (testFilter) => match$6(fromUndefinedOr(testFilter), {
|
|
46144
46234
|
onNone: () => ({}),
|
|
46145
46235
|
onSome: (present) => ({ testFilter: [...present] })
|
|
46146
46236
|
});
|
|
@@ -46162,7 +46252,7 @@ const addTestCoverage = (testsByMutantId, test, coverage) => {
|
|
|
46162
46252
|
};
|
|
46163
46253
|
const testsByMutantIdOf = (mutantCoverage, testsById) => {
|
|
46164
46254
|
const testsByMutantId = empty$5();
|
|
46165
|
-
for (const [testId, coverage] of Object.entries(mutantCoverage.perTest)) match$
|
|
46255
|
+
for (const [testId, coverage] of Object.entries(mutantCoverage.perTest)) match$6(get$7(testsById, testId), {
|
|
46166
46256
|
onNone: () => void 0,
|
|
46167
46257
|
onSome: (test) => addTestCoverage(testsByMutantId, test, coverage)
|
|
46168
46258
|
});
|
|
@@ -46184,16 +46274,16 @@ const testCoverageFrom = (result) => {
|
|
|
46184
46274
|
const testsById = testsByIdOf(result);
|
|
46185
46275
|
const mutantCoverage = fromNullishOr(result.mutantCoverage);
|
|
46186
46276
|
return {
|
|
46187
|
-
testsByMutantId: match$
|
|
46277
|
+
testsByMutantId: match$6(mutantCoverage, {
|
|
46188
46278
|
onNone: () => empty$5(),
|
|
46189
46279
|
onSome: (coverage) => testsByMutantIdOf(coverage, testsById)
|
|
46190
46280
|
}),
|
|
46191
46281
|
testsById,
|
|
46192
|
-
staticCoverage: match$
|
|
46282
|
+
staticCoverage: match$6(mutantCoverage, {
|
|
46193
46283
|
onNone: () => void 0,
|
|
46194
46284
|
onSome: (coverage) => coverage.static
|
|
46195
46285
|
}),
|
|
46196
|
-
hitsByMutantId: match$
|
|
46286
|
+
hitsByMutantId: match$6(mutantCoverage, {
|
|
46197
46287
|
onNone: () => empty$5(),
|
|
46198
46288
|
onSome: (coverage) => hitsByMutantIdOf(coverage)
|
|
46199
46289
|
})
|
|
@@ -46235,7 +46325,7 @@ const toRunPlan = (mutant, command, netTime, testFilter, isStatic, coveredBy) =>
|
|
|
46235
46325
|
const timeout = command.options.timeoutFactor * netTime + command.options.timeoutMS + command.timeOverheadMS;
|
|
46236
46326
|
const hitLimit = getHitLimit(command.hitsByMutantId[mutant.id]);
|
|
46237
46327
|
const sandboxFileName = getOrElse(fromUndefinedOr(command.sandboxFileByName[mutant.fileName]), () => mutant.fileName);
|
|
46238
|
-
const reloadEnvironment = match$
|
|
46328
|
+
const reloadEnvironment = match$6(fromUndefinedOr(testFilter), {
|
|
46239
46329
|
onNone: () => true,
|
|
46240
46330
|
onSome: () => isStatic !== false
|
|
46241
46331
|
});
|
|
@@ -46250,7 +46340,7 @@ const toRunPlan = (mutant, command, netTime, testFilter, isStatic, coveredBy) =>
|
|
|
46250
46340
|
disableBail: command.options.disableBail,
|
|
46251
46341
|
reloadEnvironment,
|
|
46252
46342
|
...testFilterField(testFilter),
|
|
46253
|
-
...match$
|
|
46343
|
+
...match$6(fromUndefinedOr(hitLimit), {
|
|
46254
46344
|
onNone: () => ({}),
|
|
46255
46345
|
onSome: (limit) => ({ hitLimit: limit })
|
|
46256
46346
|
})
|
|
@@ -46263,7 +46353,7 @@ const toEarlyResultPlan = (mutant, isStatic, status, statusReason, coveredBy) =>
|
|
|
46263
46353
|
plan: "EarlyResult",
|
|
46264
46354
|
mutantId: mutant.id,
|
|
46265
46355
|
status,
|
|
46266
|
-
...match$
|
|
46356
|
+
...match$6(fromUndefinedOr(firstDefined(statusReason, mutant.statusReason)), {
|
|
46267
46357
|
onNone: () => ({}),
|
|
46268
46358
|
onSome: (reason) => ({ statusReason: reason })
|
|
46269
46359
|
}),
|
|
@@ -46279,7 +46369,7 @@ const planForStaticallyCovered = (mutant, command, isStatic) => {
|
|
|
46279
46369
|
};
|
|
46280
46370
|
const decidePlanForMutant = (mutant, command) => {
|
|
46281
46371
|
const isStatic = hasStaticCoverageForPlan(command.staticCoverage, mutant.id);
|
|
46282
|
-
return match$
|
|
46372
|
+
return match$6(fromUndefinedOr(mutant.status), {
|
|
46283
46373
|
onSome: (status) => toEarlyResultPlan(mutant, isStatic, status, mutant.statusReason, getCoveredBy(mutant)),
|
|
46284
46374
|
onNone: () => value(hasCoverageForPlan(command.staticCoverage)).pipe(when(true, () => planForStaticallyCovered(mutant, command, isStatic)), orElse(() => toRunPlan(mutant, command, command.timeSpentAllTests, getTestFilter(command.globalTestFilter), void 0, void 0)))
|
|
46285
46375
|
});
|
|
@@ -46318,7 +46408,7 @@ const coverageToCommand = (mutants, testCoverage, options, timeOverheadMS, globa
|
|
|
46318
46408
|
testTimeById: testTimeRecordOf(testCoverage),
|
|
46319
46409
|
options,
|
|
46320
46410
|
sandboxFileByName,
|
|
46321
|
-
...match$
|
|
46411
|
+
...match$6(fromUndefinedOr(testCoverage.staticCoverage), {
|
|
46322
46412
|
onNone: () => ({}),
|
|
46323
46413
|
onSome: (staticCoverage) => ({ staticCoverage })
|
|
46324
46414
|
}),
|
|
@@ -46335,21 +46425,21 @@ const materializeMutant = (original, decided) => {
|
|
|
46335
46425
|
mutatorName: original.mutatorName,
|
|
46336
46426
|
replacement: original.replacement,
|
|
46337
46427
|
location: original.location,
|
|
46338
|
-
...match$
|
|
46428
|
+
...match$6(fromUndefinedOr(status), {
|
|
46339
46429
|
onNone: () => ({}),
|
|
46340
46430
|
onSome: (present) => ({ status: present })
|
|
46341
46431
|
}),
|
|
46342
|
-
...match$
|
|
46432
|
+
...match$6(fromUndefinedOr(statusReason), {
|
|
46343
46433
|
onNone: () => ({}),
|
|
46344
46434
|
onSome: (present) => ({ statusReason: present })
|
|
46345
46435
|
}),
|
|
46346
46436
|
...staticField(isStatic),
|
|
46347
46437
|
...coveredByField(coveredBy),
|
|
46348
|
-
...match$
|
|
46438
|
+
...match$6(fromUndefinedOr(original.testsCompleted), {
|
|
46349
46439
|
onNone: () => ({}),
|
|
46350
46440
|
onSome: (present) => ({ testsCompleted: present })
|
|
46351
46441
|
}),
|
|
46352
|
-
...match$
|
|
46442
|
+
...match$6(fromUndefinedOr(original.description), {
|
|
46353
46443
|
onNone: () => ({}),
|
|
46354
46444
|
onSome: (present) => ({ description: present })
|
|
46355
46445
|
})
|
|
@@ -46373,7 +46463,7 @@ const materializePlan = (plan, original) => {
|
|
|
46373
46463
|
disableBail: plan.runOptions.disableBail,
|
|
46374
46464
|
reloadEnvironment: plan.runOptions.reloadEnvironment,
|
|
46375
46465
|
...testFilterField(plan.runOptions.testFilter),
|
|
46376
|
-
...match$
|
|
46466
|
+
...match$6(fromUndefinedOr(plan.runOptions.hitLimit), {
|
|
46377
46467
|
onNone: () => ({}),
|
|
46378
46468
|
onSome: (hitLimit) => ({ hitLimit })
|
|
46379
46469
|
})
|
|
@@ -46429,7 +46519,7 @@ const isRememberable = (previous, mutant, input, file, changedFiles, changedTest
|
|
|
46429
46519
|
const decideForMutant = (mutant, input, changedFiles, changedTests) => {
|
|
46430
46520
|
const file = toRelativeNormalized(mutant.fileName, input.basePath);
|
|
46431
46521
|
const previous = findRemembered(input.previousFiles, file, currentMutantKey(mutant));
|
|
46432
|
-
return match$
|
|
46522
|
+
return match$6(filter$2(fromUndefinedOr(previous), (candidate) => isRememberable(candidate, mutant, input, file, changedFiles, changedTests)), {
|
|
46433
46523
|
onNone: () => ({ kind: "run" }),
|
|
46434
46524
|
onSome: (present) => ({
|
|
46435
46525
|
kind: "remembered",
|
|
@@ -46478,15 +46568,15 @@ const removedMutantFiles = (input, currentKeysByFile) => Object.entries(input.pr
|
|
|
46478
46568
|
const rememberedEntryOf = (mutant, previous) => ({
|
|
46479
46569
|
mutantId: mutant.id,
|
|
46480
46570
|
status: previous.status,
|
|
46481
|
-
...match$
|
|
46571
|
+
...match$6(fromUndefinedOr(previous.testsCompleted), {
|
|
46482
46572
|
onNone: () => ({}),
|
|
46483
46573
|
onSome: (testsCompleted) => ({ testsCompleted })
|
|
46484
46574
|
}),
|
|
46485
|
-
...match$
|
|
46575
|
+
...match$6(fromUndefinedOr(previous.coveredBy), {
|
|
46486
46576
|
onNone: () => ({}),
|
|
46487
46577
|
onSome: (coveredBy) => ({ coveredBy })
|
|
46488
46578
|
}),
|
|
46489
|
-
...match$
|
|
46579
|
+
...match$6(fromUndefinedOr(previous.killedBy), {
|
|
46490
46580
|
onNone: () => ({}),
|
|
46491
46581
|
onSome: (killedBy) => ({ killedBy })
|
|
46492
46582
|
})
|
|
@@ -46531,8 +46621,8 @@ const incrementalDiffOfChanges = (input) => {
|
|
|
46531
46621
|
};
|
|
46532
46622
|
};
|
|
46533
46623
|
const computeIncrementalDiff = (input) => value(input.force).pipe(when(true, () => forcedDiff(input)), orElse(() => incrementalDiffOfChanges(input)));
|
|
46534
|
-
const previousFilesOf = (rawReport) => value(rawReport).pipe(when(isObject, (report) => getOrElse(filter$
|
|
46535
|
-
const previousTestFilesOf = (rawReport) => value(rawReport).pipe(when(isObject, (report) => getOrElse(filter$
|
|
46624
|
+
const previousFilesOf = (rawReport) => value(rawReport).pipe(when(isObject, (report) => getOrElse(filter$2(fromUndefinedOr(report["files"]), is$2(PreviousFilesSchema)), () => ({}))), orElse(() => ({})));
|
|
46625
|
+
const previousTestFilesOf = (rawReport) => value(rawReport).pipe(when(isObject, (report) => getOrElse(filter$2(fromUndefinedOr(report["testFiles"]), is$2(PreviousTestFilesSchema)), () => ({}))), orElse(() => ({})));
|
|
46536
46626
|
const hasTestFileName = (result) => result.fileName !== void 0;
|
|
46537
46627
|
const testIdsByRelativeFile = (testCoverage, basePath) => {
|
|
46538
46628
|
const byFile = {};
|
|
@@ -46581,1541 +46671,41 @@ const incrementalDiff = (input) => {
|
|
|
46581
46671
|
};
|
|
46582
46672
|
};
|
|
46583
46673
|
//#endregion
|
|
46584
|
-
//#region
|
|
46585
|
-
const
|
|
46586
|
-
|
|
46587
|
-
|
|
46588
|
-
|
|
46589
|
-
|
|
46590
|
-
|
|
46591
|
-
|
|
46592
|
-
|
|
46593
|
-
|
|
46594
|
-
|
|
46595
|
-
|
|
46596
|
-
}
|
|
46597
|
-
const
|
|
46598
|
-
|
|
46599
|
-
|
|
46600
|
-
};
|
|
46601
|
-
|
|
46602
|
-
|
|
46603
|
-
|
|
46604
|
-
|
|
46605
|
-
|
|
46606
|
-
|
|
46607
|
-
|
|
46608
|
-
|
|
46609
|
-
|
|
46610
|
-
|
|
46611
|
-
|
|
46612
|
-
|
|
46613
|
-
|
|
46614
|
-
|
|
46615
|
-
|
|
46616
|
-
|
|
46617
|
-
|
|
46618
|
-
beg = begs.pop();
|
|
46619
|
-
if (beg !== void 0 && beg < left) {
|
|
46620
|
-
left = beg;
|
|
46621
|
-
right = bi;
|
|
46622
|
-
}
|
|
46623
|
-
bi = str.indexOf(b, i + 1);
|
|
46624
|
-
}
|
|
46625
|
-
i = ai < bi && ai >= 0 ? ai : bi;
|
|
46626
|
-
}
|
|
46627
|
-
if (begs.length && right !== void 0) result = [left, right];
|
|
46628
|
-
}
|
|
46629
|
-
return result;
|
|
46630
|
-
};
|
|
46631
|
-
//#endregion
|
|
46632
|
-
//#region ../../node_modules/.pnpm/brace-expansion@5.0.9/node_modules/brace-expansion/dist/esm/index.js
|
|
46633
|
-
const escSlash = "\0SLASH" + Math.random() + "\0";
|
|
46634
|
-
const escOpen = "\0OPEN" + Math.random() + "\0";
|
|
46635
|
-
const escClose = "\0CLOSE" + Math.random() + "\0";
|
|
46636
|
-
const escComma = "\0COMMA" + Math.random() + "\0";
|
|
46637
|
-
const escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
46638
|
-
const escSlashPattern = new RegExp(escSlash, "g");
|
|
46639
|
-
const escOpenPattern = new RegExp(escOpen, "g");
|
|
46640
|
-
const escClosePattern = new RegExp(escClose, "g");
|
|
46641
|
-
const escCommaPattern = new RegExp(escComma, "g");
|
|
46642
|
-
const escPeriodPattern = new RegExp(escPeriod, "g");
|
|
46643
|
-
const slashPattern = /\\\\/g;
|
|
46644
|
-
const openPattern = /\\{/g;
|
|
46645
|
-
const closePattern = /\\}/g;
|
|
46646
|
-
const commaPattern = /\\,/g;
|
|
46647
|
-
const periodPattern = /\\\./g;
|
|
46648
|
-
const EXPANSION_MAX = 1e5;
|
|
46649
|
-
const EXPANSION_MAX_LENGTH = 4e6;
|
|
46650
|
-
function numeric(str) {
|
|
46651
|
-
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
46652
|
-
}
|
|
46653
|
-
function escapeBraces(str) {
|
|
46654
|
-
return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
|
|
46655
|
-
}
|
|
46656
|
-
function unescapeBraces(str) {
|
|
46657
|
-
return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
|
|
46658
|
-
}
|
|
46659
|
-
/**
|
|
46660
|
-
* Basically just str.split(","), but handling cases
|
|
46661
|
-
* where we have nested braced sections, which should be
|
|
46662
|
-
* treated as individual members, like {a,{b,c},d}
|
|
46663
|
-
*/
|
|
46664
|
-
function parseCommaParts(str) {
|
|
46665
|
-
if (!str) return [""];
|
|
46666
|
-
const parts = [];
|
|
46667
|
-
const m = balanced("{", "}", str);
|
|
46668
|
-
if (!m) return str.split(",");
|
|
46669
|
-
const { pre, body, post } = m;
|
|
46670
|
-
const p = pre.split(",");
|
|
46671
|
-
p[p.length - 1] += "{" + body + "}";
|
|
46672
|
-
const postParts = parseCommaParts(post);
|
|
46673
|
-
if (post.length) {
|
|
46674
|
-
p[p.length - 1] += postParts.shift();
|
|
46675
|
-
p.push.apply(p, postParts);
|
|
46676
|
-
}
|
|
46677
|
-
parts.push.apply(parts, p);
|
|
46678
|
-
return parts;
|
|
46679
|
-
}
|
|
46680
|
-
function expand(str, options = {}) {
|
|
46681
|
-
if (!str) return [];
|
|
46682
|
-
const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options;
|
|
46683
|
-
if (str.slice(0, 2) === "{}") str = "\\{\\}" + str.slice(2);
|
|
46684
|
-
return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
|
|
46685
|
-
}
|
|
46686
|
-
function embrace(str) {
|
|
46687
|
-
return "{" + str + "}";
|
|
46688
|
-
}
|
|
46689
|
-
function isPadded(el) {
|
|
46690
|
-
return /^-?0\d/.test(el);
|
|
46691
|
-
}
|
|
46692
|
-
function lte(i, y) {
|
|
46693
|
-
return i <= y;
|
|
46694
|
-
}
|
|
46695
|
-
function gte(i, y) {
|
|
46696
|
-
return i >= y;
|
|
46697
|
-
}
|
|
46698
|
-
function combine$2(acc, pre, values, max, maxLength, dropEmpties) {
|
|
46699
|
-
const out = [];
|
|
46700
|
-
let length = 0;
|
|
46701
|
-
for (let a = 0; a < acc.length; a++) for (let v = 0; v < values.length; v++) {
|
|
46702
|
-
if (out.length >= max) return out;
|
|
46703
|
-
const expansion = acc[a] + pre + values[v];
|
|
46704
|
-
if (dropEmpties && !expansion) continue;
|
|
46705
|
-
if (length + expansion.length > maxLength) return out;
|
|
46706
|
-
out.push(expansion);
|
|
46707
|
-
length += expansion.length;
|
|
46708
|
-
}
|
|
46709
|
-
return out;
|
|
46710
|
-
}
|
|
46711
|
-
function expandSequence(body, isAlphaSequence, max, maxLength) {
|
|
46712
|
-
const n = body.split(/\.\./);
|
|
46713
|
-
const N = [];
|
|
46714
|
-
/* c8 ignore start */
|
|
46715
|
-
if (n[0] === void 0 || n[1] === void 0) return N;
|
|
46716
|
-
/* c8 ignore stop */
|
|
46717
|
-
const x = numeric(n[0]);
|
|
46718
|
-
const y = numeric(n[1]);
|
|
46719
|
-
const width = Math.max(n[0].length, n[1].length);
|
|
46720
|
-
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
|
46721
|
-
let test = lte;
|
|
46722
|
-
if (y < x) {
|
|
46723
|
-
incr *= -1;
|
|
46724
|
-
test = gte;
|
|
46725
|
-
}
|
|
46726
|
-
const pad = n.some(isPadded);
|
|
46727
|
-
let length = 0;
|
|
46728
|
-
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
|
46729
|
-
let c;
|
|
46730
|
-
if (isAlphaSequence) {
|
|
46731
|
-
c = String.fromCharCode(i);
|
|
46732
|
-
if (c === "\\") c = "";
|
|
46733
|
-
} else {
|
|
46734
|
-
c = String(i);
|
|
46735
|
-
if (pad) {
|
|
46736
|
-
const need = width - c.length;
|
|
46737
|
-
if (need > 0) {
|
|
46738
|
-
const z = new Array(need + 1).join("0");
|
|
46739
|
-
if (i < 0) c = "-" + z + c.slice(1);
|
|
46740
|
-
else c = z + c;
|
|
46741
|
-
}
|
|
46742
|
-
}
|
|
46743
|
-
}
|
|
46744
|
-
if (length + c.length > maxLength) break;
|
|
46745
|
-
N.push(c);
|
|
46746
|
-
length += c.length;
|
|
46747
|
-
}
|
|
46748
|
-
return N;
|
|
46749
|
-
}
|
|
46750
|
-
function expand_(str, max, maxLength, isTop) {
|
|
46751
|
-
let acc = [""];
|
|
46752
|
-
let dropEmpties = false;
|
|
46753
|
-
let firstGroup = true;
|
|
46754
|
-
for (;;) {
|
|
46755
|
-
const m = balanced("{", "}", str);
|
|
46756
|
-
if (!m) return combine$2(acc, str, [""], max, maxLength, dropEmpties);
|
|
46757
|
-
const pre = m.pre;
|
|
46758
|
-
if (/\$$/.test(pre)) {
|
|
46759
|
-
acc = combine$2(acc, pre + "{" + m.body + "}", [""], max, maxLength, dropEmpties && !m.post.length);
|
|
46760
|
-
firstGroup = false;
|
|
46761
|
-
if (!m.post.length) break;
|
|
46762
|
-
str = m.post;
|
|
46763
|
-
continue;
|
|
46764
|
-
}
|
|
46765
|
-
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
46766
|
-
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
46767
|
-
const isSequence = isNumericSequence || isAlphaSequence;
|
|
46768
|
-
const isOptions = m.body.indexOf(",") >= 0;
|
|
46769
|
-
if (!isSequence && !isOptions) {
|
|
46770
|
-
if (m.post.match(/,(?!,).*\}/)) {
|
|
46771
|
-
str = m.pre + "{" + m.body + escClose + m.post;
|
|
46772
|
-
isTop = true;
|
|
46773
|
-
continue;
|
|
46774
|
-
}
|
|
46775
|
-
return combine$2(acc, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties);
|
|
46776
|
-
}
|
|
46777
|
-
if (firstGroup) {
|
|
46778
|
-
dropEmpties = isTop && !isSequence;
|
|
46779
|
-
firstGroup = false;
|
|
46780
|
-
}
|
|
46781
|
-
let values;
|
|
46782
|
-
if (isSequence) values = expandSequence(m.body, isAlphaSequence, max, maxLength);
|
|
46783
|
-
else {
|
|
46784
|
-
let n = parseCommaParts(m.body);
|
|
46785
|
-
if (n.length === 1 && n[0] !== void 0) {
|
|
46786
|
-
n = expand_(n[0], max, maxLength, false).map(embrace);
|
|
46787
|
-
/* c8 ignore start */
|
|
46788
|
-
if (n.length === 1) {
|
|
46789
|
-
acc = combine$2(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length);
|
|
46790
|
-
if (!m.post.length) break;
|
|
46791
|
-
str = m.post;
|
|
46792
|
-
continue;
|
|
46793
|
-
}
|
|
46794
|
-
}
|
|
46795
|
-
let dropsEmpties = dropEmpties && !m.post.length && !pre;
|
|
46796
|
-
for (let d = 0; dropsEmpties && d < acc.length; d++) if (acc[d]) dropsEmpties = false;
|
|
46797
|
-
values = [];
|
|
46798
|
-
let valuesLength = 0;
|
|
46799
|
-
outer: for (let j = 0; j < n.length; j++) {
|
|
46800
|
-
const expanded = expand_(n[j], max, maxLength, false);
|
|
46801
|
-
for (let k = 0; k < expanded.length; k++) {
|
|
46802
|
-
const v = expanded[k];
|
|
46803
|
-
if (dropsEmpties && !v) continue;
|
|
46804
|
-
if (values.length >= max || valuesLength + v.length > maxLength) break outer;
|
|
46805
|
-
values.push(v);
|
|
46806
|
-
valuesLength += v.length;
|
|
46807
|
-
}
|
|
46808
|
-
}
|
|
46809
|
-
}
|
|
46810
|
-
acc = combine$2(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
|
|
46811
|
-
if (!m.post.length) break;
|
|
46812
|
-
str = m.post;
|
|
46813
|
-
}
|
|
46814
|
-
return acc;
|
|
46815
|
-
}
|
|
46816
|
-
//#endregion
|
|
46817
|
-
//#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
46818
|
-
const MAX_PATTERN_LENGTH = 65536;
|
|
46819
|
-
const assertValidPattern = (pattern) => {
|
|
46820
|
-
if (typeof pattern !== "string") throw new TypeError("invalid pattern");
|
|
46821
|
-
if (pattern.length > MAX_PATTERN_LENGTH) throw new TypeError("pattern is too long");
|
|
46822
|
-
};
|
|
46823
|
-
//#endregion
|
|
46824
|
-
//#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js
|
|
46825
|
-
const posixClasses = {
|
|
46826
|
-
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
46827
|
-
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
46828
|
-
"[:ascii:]": ["\\x00-\\x7f", false],
|
|
46829
|
-
"[:blank:]": ["\\p{Zs}\\t", true],
|
|
46830
|
-
"[:cntrl:]": ["\\p{Cc}", true],
|
|
46831
|
-
"[:digit:]": ["\\p{Nd}", true],
|
|
46832
|
-
"[:graph:]": [
|
|
46833
|
-
"\\p{Z}\\p{C}",
|
|
46834
|
-
true,
|
|
46835
|
-
true
|
|
46836
|
-
],
|
|
46837
|
-
"[:lower:]": ["\\p{Ll}", true],
|
|
46838
|
-
"[:print:]": ["\\p{C}", true],
|
|
46839
|
-
"[:punct:]": ["\\p{P}", true],
|
|
46840
|
-
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
|
|
46841
|
-
"[:upper:]": ["\\p{Lu}", true],
|
|
46842
|
-
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
|
|
46843
|
-
"[:xdigit:]": ["A-Fa-f0-9", false]
|
|
46844
|
-
};
|
|
46845
|
-
const braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
|
|
46846
|
-
const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
46847
|
-
const rangesToString = (ranges) => ranges.join("");
|
|
46848
|
-
const parseClass = (glob, position) => {
|
|
46849
|
-
const pos = position;
|
|
46850
|
-
/* c8 ignore start */
|
|
46851
|
-
if (glob.charAt(pos) !== "[") throw new Error("not in a brace expression");
|
|
46852
|
-
/* c8 ignore stop */
|
|
46853
|
-
const ranges = [];
|
|
46854
|
-
const negs = [];
|
|
46855
|
-
let i = pos + 1;
|
|
46856
|
-
let sawStart = false;
|
|
46857
|
-
let uflag = false;
|
|
46858
|
-
let escaping = false;
|
|
46859
|
-
let negate = false;
|
|
46860
|
-
let endPos = pos;
|
|
46861
|
-
let rangeStart = "";
|
|
46862
|
-
WHILE: while (i < glob.length) {
|
|
46863
|
-
const c = glob.charAt(i);
|
|
46864
|
-
if ((c === "!" || c === "^") && i === pos + 1) {
|
|
46865
|
-
negate = true;
|
|
46866
|
-
i++;
|
|
46867
|
-
continue;
|
|
46868
|
-
}
|
|
46869
|
-
if (c === "]" && sawStart && !escaping) {
|
|
46870
|
-
endPos = i + 1;
|
|
46871
|
-
break;
|
|
46872
|
-
}
|
|
46873
|
-
sawStart = true;
|
|
46874
|
-
if (c === "\\") {
|
|
46875
|
-
if (!escaping) {
|
|
46876
|
-
escaping = true;
|
|
46877
|
-
i++;
|
|
46878
|
-
continue;
|
|
46879
|
-
}
|
|
46880
|
-
}
|
|
46881
|
-
if (c === "[" && !escaping) {
|
|
46882
|
-
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) if (glob.startsWith(cls, i)) {
|
|
46883
|
-
if (rangeStart) return [
|
|
46884
|
-
"$.",
|
|
46885
|
-
false,
|
|
46886
|
-
glob.length - pos,
|
|
46887
|
-
true
|
|
46888
|
-
];
|
|
46889
|
-
i += cls.length;
|
|
46890
|
-
if (neg) negs.push(unip);
|
|
46891
|
-
else ranges.push(unip);
|
|
46892
|
-
uflag = uflag || u;
|
|
46893
|
-
continue WHILE;
|
|
46894
|
-
}
|
|
46895
|
-
}
|
|
46896
|
-
escaping = false;
|
|
46897
|
-
if (rangeStart) {
|
|
46898
|
-
if (c > rangeStart) ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
|
|
46899
|
-
else if (c === rangeStart) ranges.push(braceEscape(c));
|
|
46900
|
-
rangeStart = "";
|
|
46901
|
-
i++;
|
|
46902
|
-
continue;
|
|
46903
|
-
}
|
|
46904
|
-
if (glob.startsWith("-]", i + 1)) {
|
|
46905
|
-
ranges.push(braceEscape(c + "-"));
|
|
46906
|
-
i += 2;
|
|
46907
|
-
continue;
|
|
46908
|
-
}
|
|
46909
|
-
if (glob.startsWith("-", i + 1)) {
|
|
46910
|
-
rangeStart = c;
|
|
46911
|
-
i += 2;
|
|
46912
|
-
continue;
|
|
46913
|
-
}
|
|
46914
|
-
ranges.push(braceEscape(c));
|
|
46915
|
-
i++;
|
|
46916
|
-
}
|
|
46917
|
-
if (endPos < i) return [
|
|
46918
|
-
"",
|
|
46919
|
-
false,
|
|
46920
|
-
0,
|
|
46921
|
-
false
|
|
46922
|
-
];
|
|
46923
|
-
if (!ranges.length && !negs.length) return [
|
|
46924
|
-
"$.",
|
|
46925
|
-
false,
|
|
46926
|
-
glob.length - pos,
|
|
46927
|
-
true
|
|
46928
|
-
];
|
|
46929
|
-
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
46930
|
-
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
46931
|
-
return [
|
|
46932
|
-
regexpEscape(r),
|
|
46933
|
-
false,
|
|
46934
|
-
endPos - pos,
|
|
46935
|
-
false
|
|
46936
|
-
];
|
|
46937
|
-
}
|
|
46938
|
-
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
46939
|
-
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
46940
|
-
return [
|
|
46941
|
-
ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs,
|
|
46942
|
-
uflag,
|
|
46943
|
-
endPos - pos,
|
|
46944
|
-
true
|
|
46945
|
-
];
|
|
46946
|
-
};
|
|
46947
|
-
//#endregion
|
|
46948
|
-
//#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js
|
|
46949
|
-
/**
|
|
46950
|
-
* Un-escape a string that has been escaped with {@link escape}.
|
|
46951
|
-
*
|
|
46952
|
-
* If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
|
|
46953
|
-
* square-bracket escapes are removed, but not backslash escapes.
|
|
46954
|
-
*
|
|
46955
|
-
* For example, it will turn the string `'[*]'` into `*`, but it will not
|
|
46956
|
-
* turn `'\\*'` into `'*'`, because `\` is a path separator in
|
|
46957
|
-
* `windowsPathsNoEscape` mode.
|
|
46958
|
-
*
|
|
46959
|
-
* When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
|
|
46960
|
-
* backslash escapes are removed.
|
|
46961
|
-
*
|
|
46962
|
-
* Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
|
|
46963
|
-
* or unescaped.
|
|
46964
|
-
*
|
|
46965
|
-
* When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
|
|
46966
|
-
* unescaped.
|
|
46967
|
-
*/
|
|
46968
|
-
const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
|
|
46969
|
-
if (magicalBraces) return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
|
|
46970
|
-
return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
|
|
46971
|
-
};
|
|
46972
|
-
//#endregion
|
|
46973
|
-
//#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js
|
|
46974
|
-
var _a;
|
|
46975
|
-
const types = /* @__PURE__ */ new Set([
|
|
46976
|
-
"!",
|
|
46977
|
-
"?",
|
|
46978
|
-
"+",
|
|
46979
|
-
"*",
|
|
46980
|
-
"@"
|
|
46981
|
-
]);
|
|
46982
|
-
const isExtglobType = (c) => types.has(c);
|
|
46983
|
-
const isExtglobAST = (c) => isExtglobType(c.type);
|
|
46984
|
-
const adoptionMap = /* @__PURE__ */ new Map([
|
|
46985
|
-
["!", ["@"]],
|
|
46986
|
-
["?", ["?", "@"]],
|
|
46987
|
-
["@", ["@"]],
|
|
46988
|
-
["*", [
|
|
46989
|
-
"*",
|
|
46990
|
-
"+",
|
|
46991
|
-
"?",
|
|
46992
|
-
"@"
|
|
46993
|
-
]],
|
|
46994
|
-
["+", ["+", "@"]]
|
|
46995
|
-
]);
|
|
46996
|
-
const adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
|
46997
|
-
["!", ["?"]],
|
|
46998
|
-
["@", ["?"]],
|
|
46999
|
-
["+", ["?", "*"]]
|
|
47000
|
-
]);
|
|
47001
|
-
const adoptionAnyMap = /* @__PURE__ */ new Map([
|
|
47002
|
-
["!", ["?", "@"]],
|
|
47003
|
-
["?", ["?", "@"]],
|
|
47004
|
-
["@", ["?", "@"]],
|
|
47005
|
-
["*", [
|
|
47006
|
-
"*",
|
|
47007
|
-
"+",
|
|
47008
|
-
"?",
|
|
47009
|
-
"@"
|
|
47010
|
-
]],
|
|
47011
|
-
["+", [
|
|
47012
|
-
"+",
|
|
47013
|
-
"@",
|
|
47014
|
-
"?",
|
|
47015
|
-
"*"
|
|
47016
|
-
]]
|
|
47017
|
-
]);
|
|
47018
|
-
const usurpMap = /* @__PURE__ */ new Map([
|
|
47019
|
-
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
47020
|
-
["?", /* @__PURE__ */ new Map([["*", "*"], ["+", "*"]])],
|
|
47021
|
-
["@", /* @__PURE__ */ new Map([
|
|
47022
|
-
["!", "!"],
|
|
47023
|
-
["?", "?"],
|
|
47024
|
-
["@", "@"],
|
|
47025
|
-
["*", "*"],
|
|
47026
|
-
["+", "+"]
|
|
47027
|
-
])],
|
|
47028
|
-
["+", /* @__PURE__ */ new Map([["?", "*"], ["*", "*"]])]
|
|
47029
|
-
]);
|
|
47030
|
-
const startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
47031
|
-
const startNoDot = "(?!\\.)";
|
|
47032
|
-
const addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
47033
|
-
const justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
47034
|
-
const reSpecials = /* @__PURE__ */ new Set("().*{}+?[]^$\\!");
|
|
47035
|
-
const regExpEscape$1 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
47036
|
-
const qmark = "[^/]";
|
|
47037
|
-
const star$1 = "[^/]*?";
|
|
47038
|
-
const starNoEmpty = "[^/]+?";
|
|
47039
|
-
let ID = 0;
|
|
47040
|
-
var AST = class {
|
|
47041
|
-
type;
|
|
47042
|
-
#root;
|
|
47043
|
-
#hasMagic;
|
|
47044
|
-
#uflag = false;
|
|
47045
|
-
#parts = [];
|
|
47046
|
-
#parent;
|
|
47047
|
-
#parentIndex;
|
|
47048
|
-
#negs;
|
|
47049
|
-
#filledNegs = false;
|
|
47050
|
-
#options;
|
|
47051
|
-
#toString;
|
|
47052
|
-
#emptyExt = false;
|
|
47053
|
-
id = ++ID;
|
|
47054
|
-
get depth() {
|
|
47055
|
-
return (this.#parent?.depth ?? -1) + 1;
|
|
47056
|
-
}
|
|
47057
|
-
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
47058
|
-
return {
|
|
47059
|
-
"@@type": "AST",
|
|
47060
|
-
id: this.id,
|
|
47061
|
-
type: this.type,
|
|
47062
|
-
root: this.#root.id,
|
|
47063
|
-
parent: this.#parent?.id,
|
|
47064
|
-
depth: this.depth,
|
|
47065
|
-
partsLength: this.#parts.length,
|
|
47066
|
-
parts: this.#parts
|
|
47067
|
-
};
|
|
47068
|
-
}
|
|
47069
|
-
constructor(type, parent, options = {}) {
|
|
47070
|
-
this.type = type;
|
|
47071
|
-
if (type) this.#hasMagic = true;
|
|
47072
|
-
this.#parent = parent;
|
|
47073
|
-
this.#root = this.#parent ? this.#parent.#root : this;
|
|
47074
|
-
this.#options = this.#root === this ? options : this.#root.#options;
|
|
47075
|
-
this.#negs = this.#root === this ? [] : this.#root.#negs;
|
|
47076
|
-
if (type === "!" && !this.#root.#filledNegs) this.#negs.push(this);
|
|
47077
|
-
this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
|
|
47078
|
-
}
|
|
47079
|
-
get hasMagic() {
|
|
47080
|
-
/* c8 ignore start */
|
|
47081
|
-
if (this.#hasMagic !== void 0) return this.#hasMagic;
|
|
47082
|
-
/* c8 ignore stop */
|
|
47083
|
-
for (const p of this.#parts) {
|
|
47084
|
-
if (typeof p === "string") continue;
|
|
47085
|
-
if (p.type || p.hasMagic) return this.#hasMagic = true;
|
|
47086
|
-
}
|
|
47087
|
-
return this.#hasMagic;
|
|
47088
|
-
}
|
|
47089
|
-
toString() {
|
|
47090
|
-
return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p) => String(p)).join("") : this.#toString = this.type + "(" + this.#parts.map((p) => String(p)).join("|") + ")";
|
|
47091
|
-
}
|
|
47092
|
-
#fillNegs() {
|
|
47093
|
-
/* c8 ignore start */
|
|
47094
|
-
if (this !== this.#root) throw new Error("should only call on root");
|
|
47095
|
-
if (this.#filledNegs) return this;
|
|
47096
|
-
/* c8 ignore stop */
|
|
47097
|
-
this.toString();
|
|
47098
|
-
this.#filledNegs = true;
|
|
47099
|
-
let n;
|
|
47100
|
-
while (n = this.#negs.pop()) {
|
|
47101
|
-
if (n.type !== "!") continue;
|
|
47102
|
-
let p = n;
|
|
47103
|
-
let pp = p.#parent;
|
|
47104
|
-
while (pp) {
|
|
47105
|
-
for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) for (const part of n.#parts) {
|
|
47106
|
-
/* c8 ignore start */
|
|
47107
|
-
if (typeof part === "string") throw new Error("string part in extglob AST??");
|
|
47108
|
-
/* c8 ignore stop */
|
|
47109
|
-
part.copyIn(pp.#parts[i]);
|
|
47110
|
-
}
|
|
47111
|
-
p = pp;
|
|
47112
|
-
pp = p.#parent;
|
|
47113
|
-
}
|
|
47114
|
-
}
|
|
47115
|
-
return this;
|
|
47116
|
-
}
|
|
47117
|
-
push(...parts) {
|
|
47118
|
-
for (const p of parts) {
|
|
47119
|
-
if (p === "") continue;
|
|
47120
|
-
/* c8 ignore start */
|
|
47121
|
-
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) throw new Error("invalid part: " + p);
|
|
47122
|
-
/* c8 ignore stop */
|
|
47123
|
-
this.#parts.push(p);
|
|
47124
|
-
}
|
|
47125
|
-
}
|
|
47126
|
-
toJSON() {
|
|
47127
|
-
const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
|
|
47128
|
-
if (this.isStart() && !this.type) ret.unshift([]);
|
|
47129
|
-
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) ret.push({});
|
|
47130
|
-
return ret;
|
|
47131
|
-
}
|
|
47132
|
-
isStart() {
|
|
47133
|
-
if (this.#root === this) return true;
|
|
47134
|
-
if (!this.#parent?.isStart()) return false;
|
|
47135
|
-
if (this.#parentIndex === 0) return true;
|
|
47136
|
-
const p = this.#parent;
|
|
47137
|
-
for (let i = 0; i < this.#parentIndex; i++) {
|
|
47138
|
-
const pp = p.#parts[i];
|
|
47139
|
-
if (!(pp instanceof _a && pp.type === "!")) return false;
|
|
47140
|
-
}
|
|
47141
|
-
return true;
|
|
47142
|
-
}
|
|
47143
|
-
isEnd() {
|
|
47144
|
-
if (this.#root === this) return true;
|
|
47145
|
-
if (this.#parent?.type === "!") return true;
|
|
47146
|
-
if (!this.#parent?.isEnd()) return false;
|
|
47147
|
-
if (!this.type) return this.#parent?.isEnd();
|
|
47148
|
-
/* c8 ignore start */
|
|
47149
|
-
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
47150
|
-
/* c8 ignore stop */
|
|
47151
|
-
return this.#parentIndex === pl - 1;
|
|
47152
|
-
}
|
|
47153
|
-
copyIn(part) {
|
|
47154
|
-
if (typeof part === "string") this.push(part);
|
|
47155
|
-
else this.push(part.clone(this));
|
|
47156
|
-
}
|
|
47157
|
-
clone(parent) {
|
|
47158
|
-
const c = new _a(this.type, parent);
|
|
47159
|
-
for (const p of this.#parts) c.copyIn(p);
|
|
47160
|
-
return c;
|
|
47161
|
-
}
|
|
47162
|
-
static #parseAST(str, ast, pos, opt, extDepth) {
|
|
47163
|
-
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
|
47164
|
-
let escaping = false;
|
|
47165
|
-
let inBrace = false;
|
|
47166
|
-
let braceStart = -1;
|
|
47167
|
-
let braceNeg = false;
|
|
47168
|
-
if (ast.type === null) {
|
|
47169
|
-
let i = pos;
|
|
47170
|
-
let acc = "";
|
|
47171
|
-
while (i < str.length) {
|
|
47172
|
-
const c = str.charAt(i++);
|
|
47173
|
-
if (escaping || c === "\\") {
|
|
47174
|
-
escaping = !escaping;
|
|
47175
|
-
acc += c;
|
|
47176
|
-
continue;
|
|
47177
|
-
}
|
|
47178
|
-
if (inBrace) {
|
|
47179
|
-
if (i === braceStart + 1) {
|
|
47180
|
-
if (c === "^" || c === "!") braceNeg = true;
|
|
47181
|
-
} else if (c === "]" && !(i === braceStart + 2 && braceNeg)) inBrace = false;
|
|
47182
|
-
acc += c;
|
|
47183
|
-
continue;
|
|
47184
|
-
} else if (c === "[") {
|
|
47185
|
-
inBrace = true;
|
|
47186
|
-
braceStart = i;
|
|
47187
|
-
braceNeg = false;
|
|
47188
|
-
acc += c;
|
|
47189
|
-
continue;
|
|
47190
|
-
}
|
|
47191
|
-
if (!opt.noext && isExtglobType(c) && str.charAt(i) === "(" && extDepth <= maxDepth) {
|
|
47192
|
-
ast.push(acc);
|
|
47193
|
-
acc = "";
|
|
47194
|
-
const ext = new _a(c, ast);
|
|
47195
|
-
i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
|
|
47196
|
-
ast.push(ext);
|
|
47197
|
-
continue;
|
|
47198
|
-
}
|
|
47199
|
-
acc += c;
|
|
47200
|
-
}
|
|
47201
|
-
ast.push(acc);
|
|
47202
|
-
return i;
|
|
47203
|
-
}
|
|
47204
|
-
let i = pos + 1;
|
|
47205
|
-
let part = new _a(null, ast);
|
|
47206
|
-
const parts = [];
|
|
47207
|
-
let acc = "";
|
|
47208
|
-
while (i < str.length) {
|
|
47209
|
-
const c = str.charAt(i++);
|
|
47210
|
-
if (escaping || c === "\\") {
|
|
47211
|
-
escaping = !escaping;
|
|
47212
|
-
acc += c;
|
|
47213
|
-
continue;
|
|
47214
|
-
}
|
|
47215
|
-
if (inBrace) {
|
|
47216
|
-
if (i === braceStart + 1) {
|
|
47217
|
-
if (c === "^" || c === "!") braceNeg = true;
|
|
47218
|
-
} else if (c === "]" && !(i === braceStart + 2 && braceNeg)) inBrace = false;
|
|
47219
|
-
acc += c;
|
|
47220
|
-
continue;
|
|
47221
|
-
} else if (c === "[") {
|
|
47222
|
-
inBrace = true;
|
|
47223
|
-
braceStart = i;
|
|
47224
|
-
braceNeg = false;
|
|
47225
|
-
acc += c;
|
|
47226
|
-
continue;
|
|
47227
|
-
}
|
|
47228
|
-
/* c8 ignore stop */
|
|
47229
|
-
if (!opt.noext && isExtglobType(c) && str.charAt(i) === "(" && (extDepth <= maxDepth || ast && ast.#canAdoptType(c))) {
|
|
47230
|
-
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
|
47231
|
-
part.push(acc);
|
|
47232
|
-
acc = "";
|
|
47233
|
-
const ext = new _a(c, part);
|
|
47234
|
-
part.push(ext);
|
|
47235
|
-
i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
|
|
47236
|
-
continue;
|
|
47237
|
-
}
|
|
47238
|
-
if (c === "|") {
|
|
47239
|
-
part.push(acc);
|
|
47240
|
-
acc = "";
|
|
47241
|
-
parts.push(part);
|
|
47242
|
-
part = new _a(null, ast);
|
|
47243
|
-
continue;
|
|
47244
|
-
}
|
|
47245
|
-
if (c === ")") {
|
|
47246
|
-
if (acc === "" && ast.#parts.length === 0) ast.#emptyExt = true;
|
|
47247
|
-
part.push(acc);
|
|
47248
|
-
acc = "";
|
|
47249
|
-
ast.push(...parts, part);
|
|
47250
|
-
return i;
|
|
47251
|
-
}
|
|
47252
|
-
acc += c;
|
|
47253
|
-
}
|
|
47254
|
-
ast.type = null;
|
|
47255
|
-
ast.#hasMagic = void 0;
|
|
47256
|
-
ast.#parts = [str.substring(pos - 1)];
|
|
47257
|
-
return i;
|
|
47258
|
-
}
|
|
47259
|
-
#canAdoptWithSpace(child) {
|
|
47260
|
-
return this.#canAdopt(child, adoptionWithSpaceMap);
|
|
47261
|
-
}
|
|
47262
|
-
#canAdopt(child, map = adoptionMap) {
|
|
47263
|
-
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) return false;
|
|
47264
|
-
const gc = child.#parts[0];
|
|
47265
|
-
if (!gc || typeof gc !== "object" || gc.type === null) return false;
|
|
47266
|
-
return this.#canAdoptType(gc.type, map);
|
|
47267
|
-
}
|
|
47268
|
-
#canAdoptType(c, map = adoptionAnyMap) {
|
|
47269
|
-
return !!map.get(this.type)?.includes(c);
|
|
47270
|
-
}
|
|
47271
|
-
#adoptWithSpace(child, index) {
|
|
47272
|
-
const gc = child.#parts[0];
|
|
47273
|
-
const blank = new _a(null, gc, this.options);
|
|
47274
|
-
blank.#parts.push("");
|
|
47275
|
-
gc.push(blank);
|
|
47276
|
-
this.#adopt(child, index);
|
|
47277
|
-
}
|
|
47278
|
-
#adopt(child, index) {
|
|
47279
|
-
const gc = child.#parts[0];
|
|
47280
|
-
this.#parts.splice(index, 1, ...gc.#parts);
|
|
47281
|
-
for (const p of gc.#parts) if (typeof p === "object") p.#parent = this;
|
|
47282
|
-
this.#toString = void 0;
|
|
47283
|
-
}
|
|
47284
|
-
#canUsurpType(c) {
|
|
47285
|
-
return !!usurpMap.get(this.type)?.has(c);
|
|
47286
|
-
}
|
|
47287
|
-
#canUsurp(child) {
|
|
47288
|
-
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) return false;
|
|
47289
|
-
const gc = child.#parts[0];
|
|
47290
|
-
if (!gc || typeof gc !== "object" || gc.type === null) return false;
|
|
47291
|
-
return this.#canUsurpType(gc.type);
|
|
47292
|
-
}
|
|
47293
|
-
#usurp(child) {
|
|
47294
|
-
const m = usurpMap.get(this.type);
|
|
47295
|
-
const gc = child.#parts[0];
|
|
47296
|
-
const nt = m?.get(gc.type);
|
|
47297
|
-
/* c8 ignore start - impossible */
|
|
47298
|
-
if (!nt) return false;
|
|
47299
|
-
/* c8 ignore stop */
|
|
47300
|
-
this.#parts = gc.#parts;
|
|
47301
|
-
for (const p of this.#parts) if (typeof p === "object") p.#parent = this;
|
|
47302
|
-
this.type = nt;
|
|
47303
|
-
this.#toString = void 0;
|
|
47304
|
-
this.#emptyExt = false;
|
|
47305
|
-
}
|
|
47306
|
-
static fromGlob(pattern, options = {}) {
|
|
47307
|
-
const ast = new _a(null, void 0, options);
|
|
47308
|
-
_a.#parseAST(pattern, ast, 0, options, 0);
|
|
47309
|
-
return ast;
|
|
47310
|
-
}
|
|
47311
|
-
toMMPattern() {
|
|
47312
|
-
/* c8 ignore start */
|
|
47313
|
-
if (this !== this.#root) return this.#root.toMMPattern();
|
|
47314
|
-
/* c8 ignore stop */
|
|
47315
|
-
const glob = this.toString();
|
|
47316
|
-
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
47317
|
-
if (!(hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase())) return body;
|
|
47318
|
-
const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
|
|
47319
|
-
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
47320
|
-
_src: re,
|
|
47321
|
-
_glob: glob
|
|
47322
|
-
});
|
|
47323
|
-
}
|
|
47324
|
-
get options() {
|
|
47325
|
-
return this.#options;
|
|
47326
|
-
}
|
|
47327
|
-
toRegExpSource(allowDot) {
|
|
47328
|
-
const dot = allowDot ?? !!this.#options.dot;
|
|
47329
|
-
if (this.#root === this) {
|
|
47330
|
-
this.#flatten();
|
|
47331
|
-
this.#fillNegs();
|
|
47332
|
-
}
|
|
47333
|
-
if (!isExtglobAST(this)) {
|
|
47334
|
-
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
|
|
47335
|
-
const src = this.#parts.map((p) => {
|
|
47336
|
-
const [re, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
|
47337
|
-
this.#hasMagic = this.#hasMagic || hasMagic;
|
|
47338
|
-
this.#uflag = this.#uflag || uflag;
|
|
47339
|
-
return re;
|
|
47340
|
-
}).join("");
|
|
47341
|
-
let start = "";
|
|
47342
|
-
if (this.isStart()) {
|
|
47343
|
-
if (typeof this.#parts[0] === "string") {
|
|
47344
|
-
if (!(this.#parts.length === 1 && justDots.has(this.#parts[0]))) {
|
|
47345
|
-
const aps = addPatternStart;
|
|
47346
|
-
const needNoTrav = dot && aps.has(src.charAt(0)) || src.startsWith("\\.") && aps.has(src.charAt(2)) || src.startsWith("\\.\\.") && aps.has(src.charAt(4));
|
|
47347
|
-
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
47348
|
-
start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
47349
|
-
}
|
|
47350
|
-
}
|
|
47351
|
-
}
|
|
47352
|
-
let end = "";
|
|
47353
|
-
if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") end = "(?:$|\\/)";
|
|
47354
|
-
return [
|
|
47355
|
-
start + src + end,
|
|
47356
|
-
unescape(src),
|
|
47357
|
-
this.#hasMagic = !!this.#hasMagic,
|
|
47358
|
-
this.#uflag
|
|
47359
|
-
];
|
|
47360
|
-
}
|
|
47361
|
-
const repeated = this.type === "*" || this.type === "+";
|
|
47362
|
-
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
47363
|
-
let body = this.#partsToRegExp(dot);
|
|
47364
|
-
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
47365
|
-
const s = this.toString();
|
|
47366
|
-
const me = this;
|
|
47367
|
-
me.#parts = [s];
|
|
47368
|
-
me.type = null;
|
|
47369
|
-
me.#hasMagic = void 0;
|
|
47370
|
-
return [
|
|
47371
|
-
s,
|
|
47372
|
-
unescape(this.toString()),
|
|
47373
|
-
false,
|
|
47374
|
-
false
|
|
47375
|
-
];
|
|
47376
|
-
}
|
|
47377
|
-
let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : this.#partsToRegExp(true);
|
|
47378
|
-
if (bodyDotAllowed === body) bodyDotAllowed = "";
|
|
47379
|
-
if (bodyDotAllowed) body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
47380
|
-
let final = "";
|
|
47381
|
-
if (this.type === "!" && this.#emptyExt) final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
47382
|
-
else {
|
|
47383
|
-
const close = this.type === "!" ? "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + "[^/]*?)" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
47384
|
-
final = start + body + close;
|
|
47385
|
-
}
|
|
47386
|
-
return [
|
|
47387
|
-
final,
|
|
47388
|
-
unescape(body),
|
|
47389
|
-
this.#hasMagic = !!this.#hasMagic,
|
|
47390
|
-
this.#uflag
|
|
47391
|
-
];
|
|
47392
|
-
}
|
|
47393
|
-
#flatten() {
|
|
47394
|
-
if (!isExtglobAST(this)) {
|
|
47395
|
-
for (const p of this.#parts) if (typeof p === "object") p.#flatten();
|
|
47396
|
-
} else {
|
|
47397
|
-
let iterations = 0;
|
|
47398
|
-
let done = false;
|
|
47399
|
-
do {
|
|
47400
|
-
done = true;
|
|
47401
|
-
for (let i = 0; i < this.#parts.length; i++) {
|
|
47402
|
-
const c = this.#parts[i];
|
|
47403
|
-
if (typeof c === "object") {
|
|
47404
|
-
c.#flatten();
|
|
47405
|
-
if (this.#canAdopt(c)) {
|
|
47406
|
-
done = false;
|
|
47407
|
-
this.#adopt(c, i);
|
|
47408
|
-
} else if (this.#canAdoptWithSpace(c)) {
|
|
47409
|
-
done = false;
|
|
47410
|
-
this.#adoptWithSpace(c, i);
|
|
47411
|
-
} else if (this.#canUsurp(c)) {
|
|
47412
|
-
done = false;
|
|
47413
|
-
this.#usurp(c);
|
|
47414
|
-
}
|
|
47415
|
-
}
|
|
47416
|
-
}
|
|
47417
|
-
} while (!done && ++iterations < 10);
|
|
47418
|
-
}
|
|
47419
|
-
this.#toString = void 0;
|
|
47420
|
-
}
|
|
47421
|
-
#partsToRegExp(dot) {
|
|
47422
|
-
return this.#parts.map((p) => {
|
|
47423
|
-
/* c8 ignore start */
|
|
47424
|
-
if (typeof p === "string") throw new Error("string type in extglob ast??");
|
|
47425
|
-
/* c8 ignore stop */
|
|
47426
|
-
const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
|
|
47427
|
-
this.#uflag = this.#uflag || uflag;
|
|
47428
|
-
return re;
|
|
47429
|
-
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
47430
|
-
}
|
|
47431
|
-
static #parseGlob(glob, hasMagic, noEmpty = false) {
|
|
47432
|
-
let escaping = false;
|
|
47433
|
-
let re = "";
|
|
47434
|
-
let uflag = false;
|
|
47435
|
-
let inStar = false;
|
|
47436
|
-
for (let i = 0; i < glob.length; i++) {
|
|
47437
|
-
const c = glob.charAt(i);
|
|
47438
|
-
if (escaping) {
|
|
47439
|
-
escaping = false;
|
|
47440
|
-
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
47441
|
-
continue;
|
|
47442
|
-
}
|
|
47443
|
-
if (c === "*") {
|
|
47444
|
-
if (inStar) continue;
|
|
47445
|
-
inStar = true;
|
|
47446
|
-
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star$1;
|
|
47447
|
-
hasMagic = true;
|
|
47448
|
-
continue;
|
|
47449
|
-
} else inStar = false;
|
|
47450
|
-
if (c === "\\") {
|
|
47451
|
-
if (i === glob.length - 1) re += "\\\\";
|
|
47452
|
-
else escaping = true;
|
|
47453
|
-
continue;
|
|
47454
|
-
}
|
|
47455
|
-
if (c === "[") {
|
|
47456
|
-
const [src, needUflag, consumed, magic] = parseClass(glob, i);
|
|
47457
|
-
if (consumed) {
|
|
47458
|
-
re += src;
|
|
47459
|
-
uflag = uflag || needUflag;
|
|
47460
|
-
i += consumed - 1;
|
|
47461
|
-
hasMagic = hasMagic || magic;
|
|
47462
|
-
continue;
|
|
47463
|
-
}
|
|
47464
|
-
}
|
|
47465
|
-
if (c === "?") {
|
|
47466
|
-
re += qmark;
|
|
47467
|
-
hasMagic = true;
|
|
47468
|
-
continue;
|
|
47469
|
-
}
|
|
47470
|
-
re += regExpEscape$1(c);
|
|
47471
|
-
}
|
|
47472
|
-
return [
|
|
47473
|
-
re,
|
|
47474
|
-
unescape(glob),
|
|
47475
|
-
!!hasMagic,
|
|
47476
|
-
uflag
|
|
47477
|
-
];
|
|
47478
|
-
}
|
|
46674
|
+
//#region src/glob-match.ts
|
|
46675
|
+
const GLOB_META = /[*?[{]/;
|
|
46676
|
+
const isGlob = (value) => GLOB_META.test(value);
|
|
46677
|
+
const escapeRegex = (value) => value.replace(/[\\^$.|()+]/g, "\\$&");
|
|
46678
|
+
const globSegmentToRegex = (segment) => value(segment.length === 0).pipe(when(true, () => ""), orElse(() => {
|
|
46679
|
+
const char = segment[0] ?? "";
|
|
46680
|
+
const rest = segment.slice(1);
|
|
46681
|
+
return value(char).pipe(when("*", () => value(rest.startsWith("*")).pipe(when(true, () => {
|
|
46682
|
+
const afterStars = rest.slice(1);
|
|
46683
|
+
return value(afterStars.startsWith("/")).pipe(when(true, () => `(?:(?:[^/]+/)*)?${globSegmentToRegex(afterStars.slice(1))}`), orElse(() => `.*${globSegmentToRegex(afterStars)}`));
|
|
46684
|
+
}), orElse(() => `[^/]*${globSegmentToRegex(rest)}`))), when("?", () => `[^/]${globSegmentToRegex(rest)}`), when("{", () => {
|
|
46685
|
+
const close = segment.indexOf("}");
|
|
46686
|
+
return value(close < 0).pipe(when(true, () => `${escapeRegex(char)}${globSegmentToRegex(rest)}`), orElse(() => {
|
|
46687
|
+
const inner = segment.slice(1, close);
|
|
46688
|
+
const after = segment.slice(close + 1);
|
|
46689
|
+
return `(?:${inner.split(",").map(globSegmentToRegex).join("|")})${globSegmentToRegex(after)}`;
|
|
46690
|
+
}));
|
|
46691
|
+
}), when("[", () => {
|
|
46692
|
+
const close = segment.indexOf("]", 1);
|
|
46693
|
+
return value(close < 0).pipe(when(true, () => `${escapeRegex(char)}${globSegmentToRegex(rest)}`), orElse(() => `${segment.slice(0, close + 1)}${globSegmentToRegex(segment.slice(close + 1))}`));
|
|
46694
|
+
}), orElse(() => `${escapeRegex(char)}${globSegmentToRegex(rest)}`));
|
|
46695
|
+
}));
|
|
46696
|
+
const globToRegExp$1 = (pattern, caseInsensitive) => new RegExp(`^${globSegmentToRegex(pattern)}$`, value(caseInsensitive).pipe(when(true, () => "i"), orElse(() => "")));
|
|
46697
|
+
const matchesGlob = (path, pattern, caseInsensitive = false) => globToRegExp$1(pattern, caseInsensitive).test(path);
|
|
46698
|
+
const compileIgnoreRule = (pattern) => {
|
|
46699
|
+
const negate = pattern.startsWith("!");
|
|
46700
|
+
const glob = value(negate).pipe(when(true, () => pattern.slice(1)), orElse(() => pattern));
|
|
46701
|
+
const re = globToRegExp$1(glob, true);
|
|
46702
|
+
const prefix = new RegExp(re.source.replace(/\$$/, ""), re.flags);
|
|
46703
|
+
return {
|
|
46704
|
+
negate,
|
|
46705
|
+
matches: (candidate) => re.test(candidate),
|
|
46706
|
+
matchesPrefix: (candidate) => prefix.test(candidate)
|
|
46707
|
+
};
|
|
47479
46708
|
};
|
|
47480
|
-
_a = AST;
|
|
47481
|
-
//#endregion
|
|
47482
|
-
//#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js
|
|
47483
|
-
/**
|
|
47484
|
-
* Escape all magic characters in a glob pattern.
|
|
47485
|
-
*
|
|
47486
|
-
* If the {@link MinimatchOptions.windowsPathsNoEscape}
|
|
47487
|
-
* option is used, then characters are escaped by wrapping in `[]`, because
|
|
47488
|
-
* a magic character wrapped in a character class can only be satisfied by
|
|
47489
|
-
* that exact character. In this mode, `\` is _not_ escaped, because it is
|
|
47490
|
-
* not interpreted as a magic character, but instead as a path separator.
|
|
47491
|
-
*
|
|
47492
|
-
* If the {@link MinimatchOptions.magicalBraces} option is used,
|
|
47493
|
-
* then braces (`{` and `}`) will be escaped.
|
|
47494
|
-
*/
|
|
47495
|
-
const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
|
|
47496
|
-
if (magicalBraces) return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
47497
|
-
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
47498
|
-
};
|
|
47499
|
-
//#endregion
|
|
47500
|
-
//#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js
|
|
47501
|
-
const minimatch = (p, pattern, options = {}) => {
|
|
47502
|
-
assertValidPattern(pattern);
|
|
47503
|
-
if (!options.nocomment && pattern.charAt(0) === "#") return false;
|
|
47504
|
-
return new Minimatch(pattern, options).match(p);
|
|
47505
|
-
};
|
|
47506
|
-
const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
|
|
47507
|
-
const starDotExtTest = (ext) => (f) => !f.startsWith(".") && f.endsWith(ext);
|
|
47508
|
-
const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
|
|
47509
|
-
const starDotExtTestNocase = (ext) => {
|
|
47510
|
-
ext = ext.toLowerCase();
|
|
47511
|
-
return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext);
|
|
47512
|
-
};
|
|
47513
|
-
const starDotExtTestNocaseDot = (ext) => {
|
|
47514
|
-
ext = ext.toLowerCase();
|
|
47515
|
-
return (f) => f.toLowerCase().endsWith(ext);
|
|
47516
|
-
};
|
|
47517
|
-
const starDotStarRE = /^\*+\.\*+$/;
|
|
47518
|
-
const starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
|
|
47519
|
-
const starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
|
|
47520
|
-
const dotStarRE = /^\.\*+$/;
|
|
47521
|
-
const dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
|
|
47522
|
-
const starRE = /^\*+$/;
|
|
47523
|
-
const starTest = (f) => f.length !== 0 && !f.startsWith(".");
|
|
47524
|
-
const starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
|
|
47525
|
-
const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
|
|
47526
|
-
const qmarksTestNocase = ([$0, ext = ""]) => {
|
|
47527
|
-
const noext = qmarksTestNoExt([$0]);
|
|
47528
|
-
if (!ext) return noext;
|
|
47529
|
-
ext = ext.toLowerCase();
|
|
47530
|
-
return (f) => noext(f) && f.toLowerCase().endsWith(ext);
|
|
47531
|
-
};
|
|
47532
|
-
const qmarksTestNocaseDot = ([$0, ext = ""]) => {
|
|
47533
|
-
const noext = qmarksTestNoExtDot([$0]);
|
|
47534
|
-
if (!ext) return noext;
|
|
47535
|
-
ext = ext.toLowerCase();
|
|
47536
|
-
return (f) => noext(f) && f.toLowerCase().endsWith(ext);
|
|
47537
|
-
};
|
|
47538
|
-
const qmarksTestDot = ([$0, ext = ""]) => {
|
|
47539
|
-
const noext = qmarksTestNoExtDot([$0]);
|
|
47540
|
-
return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
|
|
47541
|
-
};
|
|
47542
|
-
const qmarksTest = ([$0, ext = ""]) => {
|
|
47543
|
-
const noext = qmarksTestNoExt([$0]);
|
|
47544
|
-
return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
|
|
47545
|
-
};
|
|
47546
|
-
const qmarksTestNoExt = ([$0]) => {
|
|
47547
|
-
const len = $0.length;
|
|
47548
|
-
return (f) => f.length === len && !f.startsWith(".");
|
|
47549
|
-
};
|
|
47550
|
-
const qmarksTestNoExtDot = ([$0]) => {
|
|
47551
|
-
const len = $0.length;
|
|
47552
|
-
return (f) => f.length === len && f !== "." && f !== "..";
|
|
47553
|
-
};
|
|
47554
|
-
/* c8 ignore start */
|
|
47555
|
-
const defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
47556
|
-
const path$3 = {
|
|
47557
|
-
win32: { sep: "\\" },
|
|
47558
|
-
posix: { sep: "/" }
|
|
47559
|
-
};
|
|
47560
|
-
minimatch.sep = defaultPlatform === "win32" ? path$3.win32.sep : path$3.posix.sep;
|
|
47561
|
-
const GLOBSTAR = Symbol("globstar **");
|
|
47562
|
-
minimatch.GLOBSTAR = GLOBSTAR;
|
|
47563
|
-
const star = "[^/]*?";
|
|
47564
|
-
const twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
47565
|
-
const twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
47566
|
-
const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
|
47567
|
-
minimatch.filter = filter;
|
|
47568
|
-
const ext = (a, b = {}) => Object.assign({}, a, b);
|
|
47569
|
-
const defaults = (def) => {
|
|
47570
|
-
if (!def || typeof def !== "object" || !Object.keys(def).length) return minimatch;
|
|
47571
|
-
const orig = minimatch;
|
|
47572
|
-
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
|
|
47573
|
-
return Object.assign(m, {
|
|
47574
|
-
Minimatch: class Minimatch extends orig.Minimatch {
|
|
47575
|
-
constructor(pattern, options = {}) {
|
|
47576
|
-
super(pattern, ext(def, options));
|
|
47577
|
-
}
|
|
47578
|
-
static defaults(options) {
|
|
47579
|
-
return orig.defaults(ext(def, options)).Minimatch;
|
|
47580
|
-
}
|
|
47581
|
-
},
|
|
47582
|
-
AST: class AST extends orig.AST {
|
|
47583
|
-
/* c8 ignore start */
|
|
47584
|
-
constructor(type, parent, options = {}) {
|
|
47585
|
-
super(type, parent, ext(def, options));
|
|
47586
|
-
}
|
|
47587
|
-
/* c8 ignore stop */
|
|
47588
|
-
static fromGlob(pattern, options = {}) {
|
|
47589
|
-
return orig.AST.fromGlob(pattern, ext(def, options));
|
|
47590
|
-
}
|
|
47591
|
-
},
|
|
47592
|
-
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
|
|
47593
|
-
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
|
|
47594
|
-
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
|
|
47595
|
-
defaults: (options) => orig.defaults(ext(def, options)),
|
|
47596
|
-
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
|
|
47597
|
-
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
|
|
47598
|
-
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
|
|
47599
|
-
sep: orig.sep,
|
|
47600
|
-
GLOBSTAR
|
|
47601
|
-
});
|
|
47602
|
-
};
|
|
47603
|
-
minimatch.defaults = defaults;
|
|
47604
|
-
const braceExpand = (pattern, options = {}) => {
|
|
47605
|
-
assertValidPattern(pattern);
|
|
47606
|
-
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) return [pattern];
|
|
47607
|
-
return expand(pattern, { max: options.braceExpandMax });
|
|
47608
|
-
};
|
|
47609
|
-
minimatch.braceExpand = braceExpand;
|
|
47610
|
-
const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
47611
|
-
minimatch.makeRe = makeRe;
|
|
47612
|
-
const match = (list, pattern, options = {}) => {
|
|
47613
|
-
const mm = new Minimatch(pattern, options);
|
|
47614
|
-
list = list.filter((f) => mm.match(f));
|
|
47615
|
-
if (mm.options.nonull && !list.length) list.push(pattern);
|
|
47616
|
-
return list;
|
|
47617
|
-
};
|
|
47618
|
-
minimatch.match = match;
|
|
47619
|
-
const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
47620
|
-
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
47621
|
-
var Minimatch = class {
|
|
47622
|
-
options;
|
|
47623
|
-
set;
|
|
47624
|
-
pattern;
|
|
47625
|
-
windowsPathsNoEscape;
|
|
47626
|
-
nonegate;
|
|
47627
|
-
negate;
|
|
47628
|
-
comment;
|
|
47629
|
-
empty;
|
|
47630
|
-
preserveMultipleSlashes;
|
|
47631
|
-
partial;
|
|
47632
|
-
globSet;
|
|
47633
|
-
globParts;
|
|
47634
|
-
nocase;
|
|
47635
|
-
isWindows;
|
|
47636
|
-
platform;
|
|
47637
|
-
windowsNoMagicRoot;
|
|
47638
|
-
maxGlobstarRecursion;
|
|
47639
|
-
regexp;
|
|
47640
|
-
constructor(pattern, options = {}) {
|
|
47641
|
-
assertValidPattern(pattern);
|
|
47642
|
-
options = options || {};
|
|
47643
|
-
this.options = options;
|
|
47644
|
-
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
|
|
47645
|
-
this.pattern = pattern;
|
|
47646
|
-
this.platform = options.platform || defaultPlatform;
|
|
47647
|
-
this.isWindows = this.platform === "win32";
|
|
47648
|
-
const awe = "allowWindowsEscape";
|
|
47649
|
-
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false;
|
|
47650
|
-
if (this.windowsPathsNoEscape) this.pattern = this.pattern.replace(/\\/g, "/");
|
|
47651
|
-
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
47652
|
-
this.regexp = null;
|
|
47653
|
-
this.negate = false;
|
|
47654
|
-
this.nonegate = !!options.nonegate;
|
|
47655
|
-
this.comment = false;
|
|
47656
|
-
this.empty = false;
|
|
47657
|
-
this.partial = !!options.partial;
|
|
47658
|
-
this.nocase = !!this.options.nocase;
|
|
47659
|
-
this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
|
|
47660
|
-
this.globSet = [];
|
|
47661
|
-
this.globParts = [];
|
|
47662
|
-
this.set = [];
|
|
47663
|
-
this.make();
|
|
47664
|
-
}
|
|
47665
|
-
hasMagic() {
|
|
47666
|
-
if (this.options.magicalBraces && this.set.length > 1) return true;
|
|
47667
|
-
for (const pattern of this.set) for (const part of pattern) if (typeof part !== "string") return true;
|
|
47668
|
-
return false;
|
|
47669
|
-
}
|
|
47670
|
-
debug(..._) {}
|
|
47671
|
-
make() {
|
|
47672
|
-
const pattern = this.pattern;
|
|
47673
|
-
const options = this.options;
|
|
47674
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
47675
|
-
this.comment = true;
|
|
47676
|
-
return;
|
|
47677
|
-
}
|
|
47678
|
-
if (!pattern) {
|
|
47679
|
-
this.empty = true;
|
|
47680
|
-
return;
|
|
47681
|
-
}
|
|
47682
|
-
this.parseNegate();
|
|
47683
|
-
this.globSet = [...new Set(this.braceExpand())];
|
|
47684
|
-
if (options.debug) this.debug = (...args) => console.error(...args);
|
|
47685
|
-
this.debug(this.pattern, this.globSet);
|
|
47686
|
-
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
47687
|
-
this.globParts = this.preprocess(rawGlobParts);
|
|
47688
|
-
this.debug(this.pattern, this.globParts);
|
|
47689
|
-
let set = this.globParts.map((s, _, __) => {
|
|
47690
|
-
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
47691
|
-
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
47692
|
-
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
47693
|
-
if (isUNC) return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
|
|
47694
|
-
else if (isDrive) return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
47695
|
-
}
|
|
47696
|
-
return s.map((ss) => this.parse(ss));
|
|
47697
|
-
});
|
|
47698
|
-
this.debug(this.pattern, set);
|
|
47699
|
-
this.set = set.filter((s) => s.indexOf(false) === -1);
|
|
47700
|
-
if (this.isWindows) for (let i = 0; i < this.set.length; i++) {
|
|
47701
|
-
const p = this.set[i];
|
|
47702
|
-
if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) p[2] = "?";
|
|
47703
|
-
}
|
|
47704
|
-
this.debug(this.pattern, this.set);
|
|
47705
|
-
}
|
|
47706
|
-
preprocess(globParts) {
|
|
47707
|
-
if (this.options.noglobstar) {
|
|
47708
|
-
for (const partset of globParts) for (let j = 0; j < partset.length; j++) if (partset[j] === "**") partset[j] = "*";
|
|
47709
|
-
}
|
|
47710
|
-
const { optimizationLevel = 1 } = this.options;
|
|
47711
|
-
if (optimizationLevel >= 2) {
|
|
47712
|
-
globParts = this.firstPhasePreProcess(globParts);
|
|
47713
|
-
globParts = this.secondPhasePreProcess(globParts);
|
|
47714
|
-
} else if (optimizationLevel >= 1) globParts = this.levelOneOptimize(globParts);
|
|
47715
|
-
else globParts = this.adjascentGlobstarOptimize(globParts);
|
|
47716
|
-
return globParts;
|
|
47717
|
-
}
|
|
47718
|
-
adjascentGlobstarOptimize(globParts) {
|
|
47719
|
-
return globParts.map((parts) => {
|
|
47720
|
-
let gs = -1;
|
|
47721
|
-
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
47722
|
-
let i = gs;
|
|
47723
|
-
while (parts[i + 1] === "**") i++;
|
|
47724
|
-
if (i !== gs) parts.splice(gs, i - gs);
|
|
47725
|
-
}
|
|
47726
|
-
return parts;
|
|
47727
|
-
});
|
|
47728
|
-
}
|
|
47729
|
-
levelOneOptimize(globParts) {
|
|
47730
|
-
return globParts.map((parts) => {
|
|
47731
|
-
parts = parts.reduce((set, part) => {
|
|
47732
|
-
const prev = set[set.length - 1];
|
|
47733
|
-
if (part === "**" && prev === "**") return set;
|
|
47734
|
-
if (part === "..") {
|
|
47735
|
-
if (prev && prev !== ".." && prev !== "." && prev !== "**") {
|
|
47736
|
-
set.pop();
|
|
47737
|
-
return set;
|
|
47738
|
-
}
|
|
47739
|
-
}
|
|
47740
|
-
set.push(part);
|
|
47741
|
-
return set;
|
|
47742
|
-
}, []);
|
|
47743
|
-
return parts.length === 0 ? [""] : parts;
|
|
47744
|
-
});
|
|
47745
|
-
}
|
|
47746
|
-
levelTwoFileOptimize(parts) {
|
|
47747
|
-
if (!Array.isArray(parts)) parts = this.slashSplit(parts);
|
|
47748
|
-
let didSomething = false;
|
|
47749
|
-
do {
|
|
47750
|
-
didSomething = false;
|
|
47751
|
-
if (!this.preserveMultipleSlashes) {
|
|
47752
|
-
for (let i = 1; i < parts.length - 1; i++) {
|
|
47753
|
-
const p = parts[i];
|
|
47754
|
-
if (i === 1 && p === "" && parts[0] === "") continue;
|
|
47755
|
-
if (p === "." || p === "") {
|
|
47756
|
-
didSomething = true;
|
|
47757
|
-
parts.splice(i, 1);
|
|
47758
|
-
i--;
|
|
47759
|
-
}
|
|
47760
|
-
}
|
|
47761
|
-
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
47762
|
-
didSomething = true;
|
|
47763
|
-
parts.pop();
|
|
47764
|
-
}
|
|
47765
|
-
}
|
|
47766
|
-
let dd = 0;
|
|
47767
|
-
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
47768
|
-
const p = parts[dd - 1];
|
|
47769
|
-
if (p && p !== "." && p !== ".." && p !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p))) {
|
|
47770
|
-
didSomething = true;
|
|
47771
|
-
parts.splice(dd - 1, 2);
|
|
47772
|
-
dd -= 2;
|
|
47773
|
-
}
|
|
47774
|
-
}
|
|
47775
|
-
} while (didSomething);
|
|
47776
|
-
return parts.length === 0 ? [""] : parts;
|
|
47777
|
-
}
|
|
47778
|
-
firstPhasePreProcess(globParts) {
|
|
47779
|
-
let didSomething = false;
|
|
47780
|
-
do {
|
|
47781
|
-
didSomething = false;
|
|
47782
|
-
for (let parts of globParts) {
|
|
47783
|
-
let gs = -1;
|
|
47784
|
-
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
47785
|
-
let gss = gs;
|
|
47786
|
-
while (parts[gss + 1] === "**") gss++;
|
|
47787
|
-
if (gss > gs) parts.splice(gs + 1, gss - gs);
|
|
47788
|
-
let next = parts[gs + 1];
|
|
47789
|
-
const p = parts[gs + 2];
|
|
47790
|
-
const p2 = parts[gs + 3];
|
|
47791
|
-
if (next !== "..") continue;
|
|
47792
|
-
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") continue;
|
|
47793
|
-
didSomething = true;
|
|
47794
|
-
parts.splice(gs, 1);
|
|
47795
|
-
const other = parts.slice(0);
|
|
47796
|
-
other[gs] = "**";
|
|
47797
|
-
globParts.push(other);
|
|
47798
|
-
gs--;
|
|
47799
|
-
}
|
|
47800
|
-
if (!this.preserveMultipleSlashes) {
|
|
47801
|
-
for (let i = 1; i < parts.length - 1; i++) {
|
|
47802
|
-
const p = parts[i];
|
|
47803
|
-
if (i === 1 && p === "" && parts[0] === "") continue;
|
|
47804
|
-
if (p === "." || p === "") {
|
|
47805
|
-
didSomething = true;
|
|
47806
|
-
parts.splice(i, 1);
|
|
47807
|
-
i--;
|
|
47808
|
-
}
|
|
47809
|
-
}
|
|
47810
|
-
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
47811
|
-
didSomething = true;
|
|
47812
|
-
parts.pop();
|
|
47813
|
-
}
|
|
47814
|
-
}
|
|
47815
|
-
let dd = 0;
|
|
47816
|
-
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
47817
|
-
const p = parts[dd - 1];
|
|
47818
|
-
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
47819
|
-
didSomething = true;
|
|
47820
|
-
const splin = dd === 1 && parts[dd + 1] === "**" ? ["."] : [];
|
|
47821
|
-
parts.splice(dd - 1, 2, ...splin);
|
|
47822
|
-
if (parts.length === 0) parts.push("");
|
|
47823
|
-
dd -= 2;
|
|
47824
|
-
}
|
|
47825
|
-
}
|
|
47826
|
-
}
|
|
47827
|
-
} while (didSomething);
|
|
47828
|
-
return globParts;
|
|
47829
|
-
}
|
|
47830
|
-
secondPhasePreProcess(globParts) {
|
|
47831
|
-
for (let i = 0; i < globParts.length - 1; i++) for (let j = i + 1; j < globParts.length; j++) {
|
|
47832
|
-
const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
|
|
47833
|
-
if (matched) {
|
|
47834
|
-
globParts[i] = [];
|
|
47835
|
-
globParts[j] = matched;
|
|
47836
|
-
break;
|
|
47837
|
-
}
|
|
47838
|
-
}
|
|
47839
|
-
return globParts.filter((gs) => gs.length);
|
|
47840
|
-
}
|
|
47841
|
-
partsMatch(a, b, emptyGSMatch = false) {
|
|
47842
|
-
let ai = 0;
|
|
47843
|
-
let bi = 0;
|
|
47844
|
-
let result = [];
|
|
47845
|
-
let which = "";
|
|
47846
|
-
while (ai < a.length && bi < b.length) if (a[ai] === b[bi]) {
|
|
47847
|
-
result.push(which === "b" ? b[bi] : a[ai]);
|
|
47848
|
-
ai++;
|
|
47849
|
-
bi++;
|
|
47850
|
-
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
|
|
47851
|
-
result.push(a[ai]);
|
|
47852
|
-
ai++;
|
|
47853
|
-
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
|
|
47854
|
-
result.push(b[bi]);
|
|
47855
|
-
bi++;
|
|
47856
|
-
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
47857
|
-
if (which === "b") return false;
|
|
47858
|
-
which = "a";
|
|
47859
|
-
result.push(a[ai]);
|
|
47860
|
-
ai++;
|
|
47861
|
-
bi++;
|
|
47862
|
-
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
47863
|
-
if (which === "a") return false;
|
|
47864
|
-
which = "b";
|
|
47865
|
-
result.push(b[bi]);
|
|
47866
|
-
ai++;
|
|
47867
|
-
bi++;
|
|
47868
|
-
} else return false;
|
|
47869
|
-
return a.length === b.length && result;
|
|
47870
|
-
}
|
|
47871
|
-
parseNegate() {
|
|
47872
|
-
if (this.nonegate) return;
|
|
47873
|
-
const pattern = this.pattern;
|
|
47874
|
-
let negate = false;
|
|
47875
|
-
let negateOffset = 0;
|
|
47876
|
-
for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
|
|
47877
|
-
negate = !negate;
|
|
47878
|
-
negateOffset++;
|
|
47879
|
-
}
|
|
47880
|
-
if (negateOffset) this.pattern = pattern.slice(negateOffset);
|
|
47881
|
-
this.negate = negate;
|
|
47882
|
-
}
|
|
47883
|
-
matchOne(file, pattern, partial = false) {
|
|
47884
|
-
let fileStartIndex = 0;
|
|
47885
|
-
let patternStartIndex = 0;
|
|
47886
|
-
if (this.isWindows) {
|
|
47887
|
-
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
47888
|
-
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
47889
|
-
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
|
|
47890
|
-
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
|
|
47891
|
-
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
|
|
47892
|
-
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
47893
|
-
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
47894
|
-
const [fd, pd] = [file[fdi], pattern[pdi]];
|
|
47895
|
-
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
47896
|
-
pattern[pdi] = fd;
|
|
47897
|
-
patternStartIndex = pdi;
|
|
47898
|
-
fileStartIndex = fdi;
|
|
47899
|
-
}
|
|
47900
|
-
}
|
|
47901
|
-
}
|
|
47902
|
-
const { optimizationLevel = 1 } = this.options;
|
|
47903
|
-
if (optimizationLevel >= 2) file = this.levelTwoFileOptimize(file);
|
|
47904
|
-
if (pattern.includes(GLOBSTAR)) return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
47905
|
-
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
47906
|
-
}
|
|
47907
|
-
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
|
47908
|
-
const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
|
|
47909
|
-
const lastgs = pattern.lastIndexOf(GLOBSTAR);
|
|
47910
|
-
const [head, body, tail] = partial ? [
|
|
47911
|
-
pattern.slice(patternIndex, firstgs),
|
|
47912
|
-
pattern.slice(firstgs + 1),
|
|
47913
|
-
[]
|
|
47914
|
-
] : [
|
|
47915
|
-
pattern.slice(patternIndex, firstgs),
|
|
47916
|
-
pattern.slice(firstgs + 1, lastgs),
|
|
47917
|
-
pattern.slice(lastgs + 1)
|
|
47918
|
-
];
|
|
47919
|
-
if (head.length) {
|
|
47920
|
-
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
|
47921
|
-
if (!this.#matchOne(fileHead, head, partial, 0, 0)) return false;
|
|
47922
|
-
fileIndex += head.length;
|
|
47923
|
-
patternIndex += head.length;
|
|
47924
|
-
}
|
|
47925
|
-
let fileTailMatch = 0;
|
|
47926
|
-
if (tail.length) {
|
|
47927
|
-
if (tail.length + fileIndex > file.length) return false;
|
|
47928
|
-
let tailStart = file.length - tail.length;
|
|
47929
|
-
if (this.#matchOne(file, tail, partial, tailStart, 0)) fileTailMatch = tail.length;
|
|
47930
|
-
else {
|
|
47931
|
-
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) return false;
|
|
47932
|
-
tailStart--;
|
|
47933
|
-
if (!this.#matchOne(file, tail, partial, tailStart, 0)) return false;
|
|
47934
|
-
fileTailMatch = tail.length + 1;
|
|
47935
|
-
}
|
|
47936
|
-
}
|
|
47937
|
-
if (!body.length) {
|
|
47938
|
-
let sawSome = !!fileTailMatch;
|
|
47939
|
-
for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
|
|
47940
|
-
const f = String(file[i]);
|
|
47941
|
-
sawSome = true;
|
|
47942
|
-
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) return false;
|
|
47943
|
-
}
|
|
47944
|
-
return partial || sawSome;
|
|
47945
|
-
}
|
|
47946
|
-
const bodySegments = [[[], 0]];
|
|
47947
|
-
let currentBody = bodySegments[0];
|
|
47948
|
-
let nonGsParts = 0;
|
|
47949
|
-
const nonGsPartsSums = [0];
|
|
47950
|
-
for (const b of body) if (b === GLOBSTAR) {
|
|
47951
|
-
nonGsPartsSums.push(nonGsParts);
|
|
47952
|
-
currentBody = [[], 0];
|
|
47953
|
-
bodySegments.push(currentBody);
|
|
47954
|
-
} else {
|
|
47955
|
-
currentBody[0].push(b);
|
|
47956
|
-
nonGsParts++;
|
|
47957
|
-
}
|
|
47958
|
-
let i = bodySegments.length - 1;
|
|
47959
|
-
const fileLength = file.length - fileTailMatch;
|
|
47960
|
-
for (const b of bodySegments) b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
|
47961
|
-
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
|
47962
|
-
}
|
|
47963
|
-
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
|
47964
|
-
const bs = bodySegments[bodyIndex];
|
|
47965
|
-
if (!bs) {
|
|
47966
|
-
for (let i = fileIndex; i < file.length; i++) {
|
|
47967
|
-
sawTail = true;
|
|
47968
|
-
const f = file[i];
|
|
47969
|
-
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) return false;
|
|
47970
|
-
}
|
|
47971
|
-
return sawTail;
|
|
47972
|
-
}
|
|
47973
|
-
const [body, after] = bs;
|
|
47974
|
-
while (fileIndex <= after) {
|
|
47975
|
-
if (this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0) && globStarDepth < this.maxGlobstarRecursion) {
|
|
47976
|
-
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
|
47977
|
-
if (sub !== false) return sub;
|
|
47978
|
-
}
|
|
47979
|
-
const f = file[fileIndex];
|
|
47980
|
-
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) return false;
|
|
47981
|
-
fileIndex++;
|
|
47982
|
-
}
|
|
47983
|
-
return partial || null;
|
|
47984
|
-
}
|
|
47985
|
-
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
|
47986
|
-
let fi;
|
|
47987
|
-
let pi;
|
|
47988
|
-
let pl;
|
|
47989
|
-
let fl;
|
|
47990
|
-
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
47991
|
-
this.debug("matchOne loop");
|
|
47992
|
-
let p = pattern[pi];
|
|
47993
|
-
let f = file[fi];
|
|
47994
|
-
this.debug(pattern, p, f);
|
|
47995
|
-
/* c8 ignore start */
|
|
47996
|
-
if (p === false || p === GLOBSTAR) return false;
|
|
47997
|
-
/* c8 ignore stop */
|
|
47998
|
-
let hit;
|
|
47999
|
-
if (typeof p === "string") {
|
|
48000
|
-
hit = f === p;
|
|
48001
|
-
this.debug("string match", p, f, hit);
|
|
48002
|
-
} else {
|
|
48003
|
-
hit = p.test(f);
|
|
48004
|
-
this.debug("pattern match", p, f, hit);
|
|
48005
|
-
}
|
|
48006
|
-
if (!hit) return false;
|
|
48007
|
-
}
|
|
48008
|
-
if (fi === fl && pi === pl) return true;
|
|
48009
|
-
else if (fi === fl) return partial;
|
|
48010
|
-
else if (pi === pl) return fi === fl - 1 && file[fi] === "";
|
|
48011
|
-
else throw new Error("wtf?");
|
|
48012
|
-
/* c8 ignore stop */
|
|
48013
|
-
}
|
|
48014
|
-
braceExpand() {
|
|
48015
|
-
return braceExpand(this.pattern, this.options);
|
|
48016
|
-
}
|
|
48017
|
-
parse(pattern) {
|
|
48018
|
-
assertValidPattern(pattern);
|
|
48019
|
-
const options = this.options;
|
|
48020
|
-
if (pattern === "**") return GLOBSTAR;
|
|
48021
|
-
if (pattern === "") return "";
|
|
48022
|
-
let m;
|
|
48023
|
-
let fastTest = null;
|
|
48024
|
-
if (m = pattern.match(starRE)) fastTest = options.dot ? starTestDot : starTest;
|
|
48025
|
-
else if (m = pattern.match(starDotExtRE)) fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
|
|
48026
|
-
else if (m = pattern.match(qmarksRE)) fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
|
|
48027
|
-
else if (m = pattern.match(starDotStarRE)) fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
|
|
48028
|
-
else if (m = pattern.match(dotStarRE)) fastTest = dotStarTest;
|
|
48029
|
-
const re = AST.fromGlob(pattern, this.options).toMMPattern();
|
|
48030
|
-
if (fastTest && typeof re === "object") Reflect.defineProperty(re, "test", { value: fastTest });
|
|
48031
|
-
return re;
|
|
48032
|
-
}
|
|
48033
|
-
makeRe() {
|
|
48034
|
-
if (this.regexp || this.regexp === false) return this.regexp;
|
|
48035
|
-
const set = this.set;
|
|
48036
|
-
if (!set.length) {
|
|
48037
|
-
this.regexp = false;
|
|
48038
|
-
return this.regexp;
|
|
48039
|
-
}
|
|
48040
|
-
const options = this.options;
|
|
48041
|
-
const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
|
48042
|
-
const flags = new Set(options.nocase ? ["i"] : []);
|
|
48043
|
-
let re = set.map((pattern) => {
|
|
48044
|
-
const pp = pattern.map((p) => {
|
|
48045
|
-
if (p instanceof RegExp) for (const f of p.flags.split("")) flags.add(f);
|
|
48046
|
-
return typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
|
|
48047
|
-
});
|
|
48048
|
-
pp.forEach((p, i) => {
|
|
48049
|
-
const next = pp[i + 1];
|
|
48050
|
-
const prev = pp[i - 1];
|
|
48051
|
-
if (p !== GLOBSTAR || prev === GLOBSTAR) return;
|
|
48052
|
-
if (prev === void 0) {
|
|
48053
|
-
if (next !== void 0 && next !== GLOBSTAR) pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
|
|
48054
|
-
else pp[i] = twoStar;
|
|
48055
|
-
} else if (next === void 0) pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
|
|
48056
|
-
else if (next !== GLOBSTAR) {
|
|
48057
|
-
pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
48058
|
-
pp[i + 1] = GLOBSTAR;
|
|
48059
|
-
}
|
|
48060
|
-
});
|
|
48061
|
-
const filtered = pp.filter((p) => p !== GLOBSTAR);
|
|
48062
|
-
if (this.partial && filtered.length >= 1) {
|
|
48063
|
-
const prefixes = [];
|
|
48064
|
-
for (let i = 1; i <= filtered.length; i++) prefixes.push(filtered.slice(0, i).join("/"));
|
|
48065
|
-
return "(?:" + prefixes.join("|") + ")";
|
|
48066
|
-
}
|
|
48067
|
-
return filtered.join("/");
|
|
48068
|
-
}).join("|");
|
|
48069
|
-
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
48070
|
-
re = "^" + open + re + close + "$";
|
|
48071
|
-
if (this.partial) re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$";
|
|
48072
|
-
if (this.negate) re = "^(?!" + re + ").+$";
|
|
48073
|
-
try {
|
|
48074
|
-
this.regexp = new RegExp(re, [...flags].join(""));
|
|
48075
|
-
} catch {
|
|
48076
|
-
this.regexp = false;
|
|
48077
|
-
}
|
|
48078
|
-
/* c8 ignore stop */
|
|
48079
|
-
return this.regexp;
|
|
48080
|
-
}
|
|
48081
|
-
slashSplit(p) {
|
|
48082
|
-
if (this.preserveMultipleSlashes) return p.split("/");
|
|
48083
|
-
else if (this.isWindows && /^\/\/[^/]+/.test(p)) return ["", ...p.split(/\/+/)];
|
|
48084
|
-
else return p.split(/\/+/);
|
|
48085
|
-
}
|
|
48086
|
-
match(f, partial = this.partial) {
|
|
48087
|
-
this.debug("match", f, this.pattern);
|
|
48088
|
-
if (this.comment) return false;
|
|
48089
|
-
if (this.empty) return f === "";
|
|
48090
|
-
if (f === "/" && partial) return true;
|
|
48091
|
-
const options = this.options;
|
|
48092
|
-
if (this.isWindows) f = f.split("\\").join("/");
|
|
48093
|
-
const ff = this.slashSplit(f);
|
|
48094
|
-
this.debug(this.pattern, "split", ff);
|
|
48095
|
-
const set = this.set;
|
|
48096
|
-
this.debug(this.pattern, "set", set);
|
|
48097
|
-
let filename = ff[ff.length - 1];
|
|
48098
|
-
if (!filename) for (let i = ff.length - 2; !filename && i >= 0; i--) filename = ff[i];
|
|
48099
|
-
for (const pattern of set) {
|
|
48100
|
-
let file = ff;
|
|
48101
|
-
if (options.matchBase && pattern.length === 1) file = [filename];
|
|
48102
|
-
if (this.matchOne(file, pattern, partial)) {
|
|
48103
|
-
if (options.flipNegate) return true;
|
|
48104
|
-
return !this.negate;
|
|
48105
|
-
}
|
|
48106
|
-
}
|
|
48107
|
-
if (options.flipNegate) return false;
|
|
48108
|
-
return this.negate;
|
|
48109
|
-
}
|
|
48110
|
-
static defaults(def) {
|
|
48111
|
-
return minimatch.defaults(def).Minimatch;
|
|
48112
|
-
}
|
|
48113
|
-
};
|
|
48114
|
-
/* c8 ignore stop */
|
|
48115
|
-
minimatch.AST = AST;
|
|
48116
|
-
minimatch.Minimatch = Minimatch;
|
|
48117
|
-
minimatch.escape = escape;
|
|
48118
|
-
minimatch.unescape = unescape;
|
|
48119
46709
|
//#endregion
|
|
48120
46710
|
//#region src/config/merge-config.ts
|
|
48121
46711
|
const usable = (value, key) => key !== "__proto__" && value !== void 0;
|
|
@@ -48127,7 +46717,7 @@ const combine$1 = (left, right) => {
|
|
|
48127
46717
|
if (isObject(left)) return combineNested(left, right);
|
|
48128
46718
|
return right;
|
|
48129
46719
|
};
|
|
48130
|
-
const mergeRecords = (base, overrides) => union$2(base, filter$
|
|
46720
|
+
const mergeRecords = (base, overrides) => union$2(base, filter$1(overrides, usable), combine$1);
|
|
48131
46721
|
const mergeConfig = (defaults, overrides) => mergeRecords(defaults, overrides);
|
|
48132
46722
|
//#endregion
|
|
48133
46723
|
//#region src/Project.ignore.ts
|
|
@@ -67210,7 +65800,7 @@ const layerFromEnv = (additionalAttributes) => effect(Resource, gen(function* ()
|
|
|
67210
65800
|
const serviceName = yield* option(string$4("OTEL_SERVICE_NAME"));
|
|
67211
65801
|
const attributes = yield* string$4("OTEL_RESOURCE_ATTRIBUTES").pipe(withDefault$2(""), map$4((s) => {
|
|
67212
65802
|
const attrs = s.split(",");
|
|
67213
|
-
return reduce$
|
|
65803
|
+
return reduce$4(attrs, {}, (acc, attr) => {
|
|
67214
65804
|
const parts = attr.split("=");
|
|
67215
65805
|
if (parts.length !== 2) return acc;
|
|
67216
65806
|
assignProperty(acc, parts[0].trim(), parts[1].trim());
|
|
@@ -70898,7 +69488,7 @@ var MetricProducerImpl = class MetricProducerImpl {
|
|
|
70898
69488
|
const intervalStartTime = isDelta ? this.previousExportTimeNanos : this.startTimeNanos;
|
|
70899
69489
|
for (let i = 0, len = snapshot.length; i < len; i++) {
|
|
70900
69490
|
const state = snapshot[i];
|
|
70901
|
-
const attributes = state.attributes ? reduce$
|
|
69491
|
+
const attributes = state.attributes ? reduce$4(Object.entries(state.attributes), {}, (acc, [key, value]) => {
|
|
70902
69492
|
assignProperty(acc, key, String(value));
|
|
70903
69493
|
return acc;
|
|
70904
69494
|
}) : {};
|
|
@@ -90282,8 +88872,8 @@ init_esm$2();
|
|
|
90282
88872
|
var import_src = require_src$1();
|
|
90283
88873
|
var import_index_shim = require_index_shim();
|
|
90284
88874
|
const CURRENT_VERSION = "00";
|
|
90285
|
-
const serializedTraceState = (traceState) => filter$
|
|
90286
|
-
const traceStateField = (traceState) => match$
|
|
88875
|
+
const serializedTraceState = (traceState) => filter$2(map$12(fromUndefinedOr(traceState), (state) => state.serialize()), (serialized) => serialized.length > 0);
|
|
88876
|
+
const traceStateField = (traceState) => match$6(serializedTraceState(traceState), {
|
|
90287
88877
|
onNone: () => ({}),
|
|
90288
88878
|
onSome: (serialized) => ({ traceState: serialized })
|
|
90289
88879
|
});
|
|
@@ -90309,13 +88899,13 @@ const inject = (request, parts) => ({
|
|
|
90309
88899
|
headers: merge(request.headers, traceHeaders(parts))
|
|
90310
88900
|
});
|
|
90311
88901
|
const hostParts = map$7(context$1(), (context$3) => orElse$2(get$9(context$3, TraceContextReference), () => partsOfSpan(trace.getSpan(context.active()))));
|
|
90312
|
-
const clientMiddleware = (options) => hostParts.pipe(flatMap$1((parts) => match$
|
|
88902
|
+
const clientMiddleware = (options) => hostParts.pipe(flatMap$1((parts) => match$6(parts, {
|
|
90313
88903
|
onNone: () => options.next(options.request),
|
|
90314
88904
|
onSome: (present) => options.next(inject(options.request, present))
|
|
90315
88905
|
})));
|
|
90316
88906
|
const layerTraceContextClient = layerClient(TraceContextMiddleware, clientMiddleware);
|
|
90317
88907
|
const SAMPLED_FLAG = 1;
|
|
90318
|
-
const traceStateOption = (traceState) => match$
|
|
88908
|
+
const traceStateOption = (traceState) => match$6(fromUndefinedOr(traceState), {
|
|
90319
88909
|
onNone: () => ({}),
|
|
90320
88910
|
onSome: (state) => ({ traceState: state })
|
|
90321
88911
|
});
|
|
@@ -90338,7 +88928,7 @@ const partsOfEffectSpan = (span) => ({
|
|
|
90338
88928
|
const serverMiddleware = (effect, options) => {
|
|
90339
88929
|
const remote = remotePartsFromHeaders(options.headers);
|
|
90340
88930
|
const attributes = { "rpc.method": options.rpc._tag };
|
|
90341
|
-
return match$
|
|
88931
|
+
return match$6(map$12(remote, externalSpanOf), {
|
|
90342
88932
|
onNone: () => useSpan(`rpc.${options.rpc._tag}`, { attributes }, () => effect),
|
|
90343
88933
|
onSome: (parent) => useSpan(`rpc.${options.rpc._tag}`, {
|
|
90344
88934
|
attributes,
|
|
@@ -90380,7 +88970,7 @@ unwrap$4(gen(function* () {
|
|
|
90380
88970
|
//#region src/VmRunner.ts
|
|
90381
88971
|
var VmRunner = class extends Service$1()("@systemfsoftware/stryker-js/VmRunner") {};
|
|
90382
88972
|
const ALL_TESTS_NAME = "All tests";
|
|
90383
|
-
const isVmRunner = (name) => name.toLowerCase() === "vm";
|
|
88973
|
+
const isVmRunner = (name) => typeof name === "string" && name.toLowerCase() === "vm";
|
|
90384
88974
|
const vmRunnerCapabilities = { reloadEnvironment: true };
|
|
90385
88975
|
const FALLBACK_FILE_NAME = "stryker-vm-tests.js";
|
|
90386
88976
|
const errorText = (error) => value(error).pipe(when(instanceOf(Error), (failure) => failure.message), orElse((value) => String(value)));
|
|
@@ -90604,7 +89194,6 @@ const makeWorkerClient = (params) => gen(function* () {
|
|
|
90604
89194
|
//#endregion
|
|
90605
89195
|
//#region src/platform/node.ts
|
|
90606
89196
|
const restrictToOwnerOrWarn = (fs, file) => fs.chmod(file, 384).pipe(catchTag("PlatformError", (cause) => logWarning(`Could not restrict "${file}" to its owner; the worker directory's own mode still protects it.`).pipe(annotateLogs("cause", cause))));
|
|
90607
|
-
const restrictSocketToOwnerOrWarn = (fs, socketPath) => value(process.platform).pipe(when("win32", () => void_$1), orElse(() => restrictToOwnerOrWarn(fs, socketPath)));
|
|
90608
89197
|
/**
|
|
90609
89198
|
* The Node worker launcher: spawn a worker child with this runtime's
|
|
90610
89199
|
* executable, host the RPC server's address as a `net` `path` endpoint (a
|
|
@@ -90634,7 +89223,7 @@ const nodeWorkerLauncherLayer = effect(WorkerLauncher, gen(function* () {
|
|
|
90634
89223
|
},
|
|
90635
89224
|
stderr: "inherit"
|
|
90636
89225
|
}).pipe(provideService(ChildProcessSpawner, spawner));
|
|
90637
|
-
const clientLayer = layerProtocolSocket({ retryTransientErrors: true }).pipe(provide$3(layerNet({ path: socketPath })), provide$3(layerNdjson)
|
|
89226
|
+
const clientLayer = layerProtocolSocket({ retryTransientErrors: true }).pipe(provide$3(layerNet({ path: socketPath })), provide$3(layerNdjson));
|
|
90638
89227
|
const exited = handle.exitCode.pipe(orDie, flatMap$1((exitCode) => fail(classifyWorkerExit(Number(handle.pid), exitCode))));
|
|
90639
89228
|
return {
|
|
90640
89229
|
pid: Number(handle.pid),
|
|
@@ -90704,13 +89293,14 @@ const toRunnerFailure = (runnerName, phase) => (error) => value(error).pipe(tag(
|
|
|
90704
89293
|
* can see.
|
|
90705
89294
|
*/
|
|
90706
89295
|
const makeChildProcessTestRunner = (params) => gen(function* () {
|
|
90707
|
-
const runnerName = params.options.testRunner;
|
|
89296
|
+
const runnerName = value(params.options.testRunner).pipe(when(isCustomTestRunner, (runner) => runner.plugin), orElse((name) => name));
|
|
89297
|
+
const execArgv = value(params.options.testRunner).pipe(when(isCustomTestRunner, (runner) => value(runner.nodeArgs).pipe(when(_undefined, () => params.options.testRunnerNodeArgs), orElse((args) => args))), orElse(() => params.options.testRunnerNodeArgs));
|
|
90708
89298
|
const optionsJson = yield* encodeWorkerOptions(params.options);
|
|
90709
89299
|
const client = yield* makeWorkerClient({
|
|
90710
89300
|
rpcs: TestRunnerRpcs,
|
|
90711
89301
|
entrypoint: params.workerEntrypoint,
|
|
90712
89302
|
workingDirectory: params.sandboxWorkingDirectory,
|
|
90713
|
-
execArgv: [...
|
|
89303
|
+
execArgv: [...execArgv],
|
|
90714
89304
|
optionsJson,
|
|
90715
89305
|
tempDirPrefix: "stryker-test-runner-",
|
|
90716
89306
|
env: {
|
|
@@ -90846,10 +89436,8 @@ const withEnvironmentReload = (retire) => (inner) => gen(function* () {
|
|
|
90846
89436
|
})
|
|
90847
89437
|
};
|
|
90848
89438
|
});
|
|
90849
|
-
/** "command" — the name this runner answers to in the options. */
|
|
90850
|
-
const commandRunnerName = "command";
|
|
90851
89439
|
/** Whether a configured runner name selects this runner. */
|
|
90852
|
-
const isCommandRunner = (name) => name.toLowerCase() ===
|
|
89440
|
+
const isCommandRunner = (name) => typeof name === "string" && name.toLowerCase() === "command";
|
|
90853
89441
|
/** Each call is a fresh process, so the environment is always reloadable. */
|
|
90854
89442
|
const commandRunnerCapabilities = { reloadEnvironment: true };
|
|
90855
89443
|
/** One test result standing for the whole command, decided by its exit code. */
|
|
@@ -90993,12 +89581,12 @@ const collectUnserializables = (groups) => {
|
|
|
90993
89581
|
const describeUnserializableArray = (value) => collectUnserializables(value.map((child, index) => describeUnserializableChild(child, index.toString())));
|
|
90994
89582
|
const describeUnserializableRecord = (value) => collectUnserializables(Object.entries(value).map(([key, child]) => describeUnserializableChild(child, key)));
|
|
90995
89583
|
const isPlainObjectValue = (value) => !Array.isArray(value) && value.constructor === Object;
|
|
90996
|
-
const classNameOf = (value$
|
|
89584
|
+
const classNameOf = (value$11) => value(value$11.constructor).pipe(when(defined, (ctor) => ctor.name), orElse(() => "Object"));
|
|
90997
89585
|
const describeUnserializableInstance = (value) => [{
|
|
90998
89586
|
path: [],
|
|
90999
89587
|
reason: `Value is an instance of "${classNameOf(value)}", this detail will get lost in translation during serialization`
|
|
91000
89588
|
}];
|
|
91001
|
-
const describeUnserializableObject = (value$
|
|
89589
|
+
const describeUnserializableObject = (value$12) => value(value$12).pipe(when(isArrayValue, describeUnserializableArray), when(isPlainObjectValue, describeUnserializableRecord), orElse(describeUnserializableInstance));
|
|
91002
89590
|
const NON_JSON_PRIMITIVE_TYPES = [
|
|
91003
89591
|
"bigint",
|
|
91004
89592
|
"function",
|
|
@@ -91069,10 +89657,6 @@ const initialExtendsStepState = {
|
|
|
91069
89657
|
visited: [],
|
|
91070
89658
|
documents: []
|
|
91071
89659
|
};
|
|
91072
|
-
const DoneTag = { _tag: "done" };
|
|
91073
|
-
const ReadTag = { _tag: "read" };
|
|
91074
|
-
const ResolveTag = { _tag: "resolve" };
|
|
91075
|
-
const RefusedTag = { _tag: "refused" };
|
|
91076
89660
|
const asUnknownArray = (value) => {
|
|
91077
89661
|
if (Array.isArray(value)) return value;
|
|
91078
89662
|
return [];
|
|
@@ -91115,11 +89699,10 @@ const stripExtends = (document) => {
|
|
|
91115
89699
|
};
|
|
91116
89700
|
const mergeChainDocuments = (documents) => documents.reduceRight((merged, entry) => mergeConfigs(merged, stripExtends(entry.options)), {});
|
|
91117
89701
|
const decideExtendsStep = (state, document, file, pathService) => {
|
|
91118
|
-
if (state.visited.includes(file)) return {
|
|
91119
|
-
...RefusedTag,
|
|
89702
|
+
if (state.visited.includes(file)) return ExtendsStepRefused.make({
|
|
91120
89703
|
reason: "cycle",
|
|
91121
89704
|
file
|
|
91122
|
-
};
|
|
89705
|
+
});
|
|
91123
89706
|
const nextState = {
|
|
91124
89707
|
visited: [...state.visited, file],
|
|
91125
89708
|
documents: [...state.documents, {
|
|
@@ -91127,22 +89710,13 @@ const decideExtendsStep = (state, document, file, pathService) => {
|
|
|
91127
89710
|
options: document
|
|
91128
89711
|
}]
|
|
91129
89712
|
};
|
|
91130
|
-
return value(document["extends"]).pipe(when(void 0, () => ({
|
|
91131
|
-
...DoneTag,
|
|
91132
|
-
options: mergeChainDocuments(nextState.documents)
|
|
91133
|
-
})), when(null, () => ({
|
|
91134
|
-
...DoneTag,
|
|
91135
|
-
options: mergeChainDocuments(nextState.documents)
|
|
91136
|
-
})), when(string$5, (extendValue) => value(isModuleSpecifier(extendValue)).pipe(when(true, () => ({
|
|
91137
|
-
...ResolveTag,
|
|
89713
|
+
return value(document["extends"]).pipe(when(void 0, () => ExtendsStepDone.make({ options: mergeChainDocuments(nextState.documents) })), when(null, () => ExtendsStepDone.make({ options: mergeChainDocuments(nextState.documents) })), when(string$5, (extendValue) => value(isModuleSpecifier(extendValue)).pipe(when(true, () => ExtendsStepResolve.make({
|
|
91138
89714
|
specifier: extendValue,
|
|
91139
89715
|
state: nextState
|
|
91140
|
-
})), when(false, () => ({
|
|
91141
|
-
...ReadTag,
|
|
89716
|
+
})), when(false, () => ExtendsStepRead.make({
|
|
91142
89717
|
path: pathService.resolve(pathService.dirname(file), extendValue),
|
|
91143
89718
|
state: nextState
|
|
91144
|
-
})), exhaustive)), orElse(() => ({
|
|
91145
|
-
...RefusedTag,
|
|
89719
|
+
})), exhaustive)), orElse(() => ExtendsStepRefused.make({
|
|
91146
89720
|
reason: "non-string-extends",
|
|
91147
89721
|
file
|
|
91148
89722
|
})));
|
|
@@ -91272,7 +89846,7 @@ const mutationRangeBoundErrors = (index, match) => {
|
|
|
91272
89846
|
const end = matchLineNumber(match, 5);
|
|
91273
89847
|
return [...startLineErrors(index, mutationRange, start), ...lineOrderErrors(index, mutationRange, start, end)];
|
|
91274
89848
|
};
|
|
91275
|
-
const requireUnmagicalMutationRange = (mutateString, index, match) => value(
|
|
89849
|
+
const requireUnmagicalMutationRange = (mutateString, index, match) => value(isGlob(mutateString)).pipe(when(true, () => [`Config option "mutate[${index}]" is invalid. Cannot combine a glob expression with a mutation range in "${mutateString}".`]), orElse(() => mutationRangeBoundErrors(index, match)));
|
|
91276
89850
|
const mutationRangeErrors = (mutateString, index) => value(MUTATION_RANGE_REGEX.exec(mutateString)).pipe(when((match) => match !== null, (match) => requireUnmagicalMutationRange(mutateString, index, match)), orElse(() => []));
|
|
91277
89851
|
const warnOnIgnoredNodeArgs = (nodeArgs) => value(nodeArgs.length > 0).pipe(when(true, () => logWarning("Using \"testRunnerNodeArgs\" together with the \"command\" test runner is not supported, these arguments will be ignored. You can add your custom arguments by setting the \"commandRunner.command\" option.")), orElse(() => void_$1));
|
|
91278
89852
|
const warnOnCommandRunnerNodeArgs = (options) => value(isCommandRunner(options.testRunner)).pipe(when(true, () => warnOnIgnoredNodeArgs(options.testRunnerNodeArgs)), orElse(() => void_$1));
|
|
@@ -91379,7 +89953,7 @@ function exists(fileName) {
|
|
|
91379
89953
|
});
|
|
91380
89954
|
}
|
|
91381
89955
|
const requireExistingConfigFile = (configFileName) => exists(configFileName).pipe(flatMap$1((doesExist) => value(doesExist).pipe(when(true, () => succeed$4(configFileName)), orElse(() => fail(ConfigFileNotFoundError.make({ file: configFileName }))))));
|
|
91382
|
-
const firstExistingConfigFile = (fileNames) => match$
|
|
89956
|
+
const firstExistingConfigFile = (fileNames) => match$6(fromUndefinedOr(fileNames[0]), {
|
|
91383
89957
|
onNone: () => succeedNone,
|
|
91384
89958
|
onSome: (head) => exists(head).pipe(flatMap$1((doesExist) => {
|
|
91385
89959
|
if (doesExist) return succeedSome(head);
|
|
@@ -91401,15 +89975,15 @@ const legacyConfigError = (file) => ConfigFileUnsupportedError.make({
|
|
|
91401
89975
|
hint: legacyConfigHint(file)
|
|
91402
89976
|
});
|
|
91403
89977
|
const legacyConfigWarning = (file, supportedFile) => logWarning(shadowedLegacyWarning(file, supportedFile));
|
|
91404
|
-
const refuseLegacyOnlyProject = () => firstLegacyConfigFile().pipe(flatMap$1((legacyFile) => match$
|
|
89978
|
+
const refuseLegacyOnlyProject = () => firstLegacyConfigFile().pipe(flatMap$1((legacyFile) => match$6(legacyFile, {
|
|
91405
89979
|
onNone: () => succeedNone,
|
|
91406
89980
|
onSome: (file) => fail(legacyConfigError(file))
|
|
91407
89981
|
})));
|
|
91408
|
-
const warnShadowedLegacyConfig = (supportedFile) => firstLegacyConfigFile().pipe(flatMap$1((legacyFile) => match$
|
|
89982
|
+
const warnShadowedLegacyConfig = (supportedFile) => firstLegacyConfigFile().pipe(flatMap$1((legacyFile) => match$6(legacyFile, {
|
|
91409
89983
|
onNone: () => succeed$4(supportedFile),
|
|
91410
89984
|
onSome: (file) => as(legacyConfigWarning(file, supportedFile), supportedFile)
|
|
91411
89985
|
})));
|
|
91412
|
-
const discoverConfigFile = () => firstExistingConfigFile([...SUPPORTED_CONFIG_FILE_NAMES]).pipe(flatMap$1((found) => match$
|
|
89986
|
+
const discoverConfigFile = () => firstExistingConfigFile([...SUPPORTED_CONFIG_FILE_NAMES]).pipe(flatMap$1((found) => match$6(found, {
|
|
91413
89987
|
onNone: () => refuseLegacyOnlyProject().pipe(map$7((legacy) => getOrUndefined$1(legacy))),
|
|
91414
89988
|
onSome: (supportedFile) => warnShadowedLegacyConfig(supportedFile)
|
|
91415
89989
|
})));
|
|
@@ -91417,7 +89991,7 @@ function findConfigFile(configFileName) {
|
|
|
91417
89991
|
return value(configFileName).pipe(when(string$5, (fileName) => configFileFor(fileName)), orElse(() => discoverConfigFile()));
|
|
91418
89992
|
}
|
|
91419
89993
|
const resolveChildExtends = (configFile, child, configEnv) => value("extends" in child).pipe(when(true, () => resolveExtends(configFile, child, configEnv)), orElse(() => succeed$4(child)));
|
|
91420
|
-
const isCiEnvironment = string$4("CI").pipe(map$7((value$
|
|
89994
|
+
const isCiEnvironment = string$4("CI").pipe(map$7((value$10) => value(value$10.trim().toLowerCase()).pipe(when("", () => false), when("0", () => false), when("false", () => false), orElse(() => true))), orElseSucceed(() => false));
|
|
91421
89995
|
function loadOptionsFromConfigFile(cliOptions, configEnv) {
|
|
91422
89996
|
return findConfigFile(cliOptions["configFile"]).pipe(flatMap$1((configFile) => value(configFile).pipe(when(void 0, () => succeed$4({})), orElse((found) => readConfigModule(found, configEnv).pipe(flatMap$1((child) => resolveChildExtends(found, child, configEnv)))))));
|
|
91423
89997
|
}
|
|
@@ -91431,7 +90005,7 @@ function readConfig(cliOptions, invocation) {
|
|
|
91431
90005
|
};
|
|
91432
90006
|
const cliRecord = yield* decodeUnknownEffect(ConfigDocumentSchema)(cliOptions).pipe(orDie);
|
|
91433
90007
|
const fileRecord = yield* loadOptionsFromConfigFile(cliRecord, configEnv);
|
|
91434
|
-
const fileOptions = yield* match$
|
|
90008
|
+
const fileOptions = yield* match$5(decodeUnknownResult(ConfigDocumentSchema)(fileRecord), {
|
|
91435
90009
|
onFailure: (cause) => fail(ConfigFileInvalidError.make({
|
|
91436
90010
|
file: "config",
|
|
91437
90011
|
cause
|
|
@@ -91484,7 +90058,7 @@ const buildPluginLoadPlan = (entries) => {
|
|
|
91484
90058
|
position,
|
|
91485
90059
|
entryIndex: declaration.entryIndex
|
|
91486
90060
|
}),
|
|
91487
|
-
shadowings: match$
|
|
90061
|
+
shadowings: match$6(get$3(acc.seen, key), {
|
|
91488
90062
|
onNone: () => acc.shadowings,
|
|
91489
90063
|
onSome: (previous) => [...acc.shadowings, {
|
|
91490
90064
|
kind: declaration.plugin.kind,
|
|
@@ -91498,11 +90072,11 @@ const buildPluginLoadPlan = (entries) => {
|
|
|
91498
90072
|
seen: empty$2(),
|
|
91499
90073
|
shadowings: []
|
|
91500
90074
|
});
|
|
91501
|
-
const winningDeclarations = declarations.filter((declaration, position) => match$
|
|
90075
|
+
const winningDeclarations = declarations.filter((declaration, position) => match$6(get$3(shadowingState.seen, `${declaration.plugin.kind}:${declaration.plugin.name}`), {
|
|
91502
90076
|
onNone: () => false,
|
|
91503
90077
|
onSome: (winner) => winner.position === position
|
|
91504
90078
|
}));
|
|
91505
|
-
const pluginsByKind = winningDeclarations.reduce((map, declaration) => match$
|
|
90079
|
+
const pluginsByKind = winningDeclarations.reduce((map, declaration) => match$6(get$3(map, declaration.plugin.kind), {
|
|
91506
90080
|
onNone: () => set$2(map, declaration.plugin.kind, [declaration.plugin]),
|
|
91507
90081
|
onSome: (existing) => set$2(map, declaration.plugin.kind, [...existing, declaration.plugin])
|
|
91508
90082
|
}), empty$2());
|
|
@@ -91516,12 +90090,12 @@ const buildPluginLoadPlan = (entries) => {
|
|
|
91516
90090
|
modulePath: declaration.moduleName,
|
|
91517
90091
|
workerEntry: worker.workerEntry
|
|
91518
90092
|
}))));
|
|
91519
|
-
const pluginModulePaths = entries.flatMap((entry) => match$
|
|
90093
|
+
const pluginModulePaths = entries.flatMap((entry) => match$6(fromUndefinedOr(entry.plugins), {
|
|
91520
90094
|
onNone: () => [],
|
|
91521
90095
|
onSome: () => [entry.moduleName]
|
|
91522
90096
|
}));
|
|
91523
90097
|
return {
|
|
91524
|
-
schemaContributions: entries.flatMap((entry) => match$
|
|
90098
|
+
schemaContributions: entries.flatMap((entry) => match$6(fromUndefinedOr(entry.schemaContribution), {
|
|
91525
90099
|
onNone: () => [],
|
|
91526
90100
|
onSome: (value) => [value]
|
|
91527
90101
|
})),
|
|
@@ -91549,7 +90123,7 @@ const hasContribution = (contributions) => [
|
|
|
91549
90123
|
contributions.schemaContribution
|
|
91550
90124
|
].some((contribution) => contribution !== void 0);
|
|
91551
90125
|
const warnUndescribedPluginModule = (descriptor) => logWarning(`Module "${descriptor}" did not contribute a StrykerJS plugin. It didn't export a "strykerPlugins", "strykerIgnorers", or "strykerValidationSchema".`).pipe(as(void 0));
|
|
91552
|
-
const describeLoadedPlugin = (descriptor, module) => match$
|
|
90126
|
+
const describeLoadedPlugin = (descriptor, module) => match$5(pluginContributionsOf(module), {
|
|
91553
90127
|
onFailure: (cause) => failPluginLoad(descriptor, cause),
|
|
91554
90128
|
onSuccess: (contributions) => value(hasContribution(contributions)).pipe(when(true, () => succeed$4(contributions)), orElse(() => warnUndescribedPluginModule(descriptor)))
|
|
91555
90129
|
});
|
|
@@ -91576,7 +90150,7 @@ function loadPlugins(pluginDescriptors) {
|
|
|
91576
90150
|
if (plugin === void 0) return;
|
|
91577
90151
|
return {
|
|
91578
90152
|
...plugin,
|
|
91579
|
-
moduleName: resolved.
|
|
90153
|
+
moduleName: resolved.specifier
|
|
91580
90154
|
};
|
|
91581
90155
|
})), { concurrency: "unbounded" }).pipe(map$7((arr) => arr.filter(isNotNullish)));
|
|
91582
90156
|
const ignorers = loaded.flatMap((entry) => entry.ignorers ?? NO_IGNORERS);
|
|
@@ -91596,6 +90170,13 @@ function loadPlugins(pluginDescriptors) {
|
|
|
91596
90170
|
};
|
|
91597
90171
|
});
|
|
91598
90172
|
}
|
|
90173
|
+
const pluginUrlsFromOptions = (options) => [
|
|
90174
|
+
...options.plugins,
|
|
90175
|
+
...options.appendPlugins,
|
|
90176
|
+
...options.ignorers,
|
|
90177
|
+
...value(options.testRunner).pipe(when(isCustomTestRunner, (runner) => [runner.plugin]), orElse(() => [])),
|
|
90178
|
+
...options.checkers.map((checker) => checker.plugin)
|
|
90179
|
+
];
|
|
91599
90180
|
function hasValidationSchemaContribution(module) {
|
|
91600
90181
|
return is$2(SchemaValidationContributionSchema)(module);
|
|
91601
90182
|
}
|
|
@@ -91612,6 +90193,28 @@ const resolvePluginWorkerEntry = (params) => requiredSource(params).pipe(map$7((
|
|
|
91612
90193
|
kind: params.kind,
|
|
91613
90194
|
entrypoint: source.workerEntry
|
|
91614
90195
|
})));
|
|
90196
|
+
const resolveConfiguredWorkerSpawn = (params) => {
|
|
90197
|
+
const byName = (name) => requiredSource({
|
|
90198
|
+
loaded: params.loaded,
|
|
90199
|
+
kind: params.kind,
|
|
90200
|
+
name
|
|
90201
|
+
}).pipe(map$7((source) => ({
|
|
90202
|
+
name,
|
|
90203
|
+
spawn: {
|
|
90204
|
+
kind: params.kind,
|
|
90205
|
+
entrypoint: source.workerEntry
|
|
90206
|
+
}
|
|
90207
|
+
})));
|
|
90208
|
+
if (typeof params.configured === "string") return byName(params.configured);
|
|
90209
|
+
const pluginUrl = params.configured.plugin;
|
|
90210
|
+
return fromOption(map$12(fromUndefinedOr(params.loaded.pluginSources.find((source) => source.kind === params.kind && source.modulePath === pluginUrl)), (source) => ({
|
|
90211
|
+
name: source.name,
|
|
90212
|
+
spawn: {
|
|
90213
|
+
kind: params.kind,
|
|
90214
|
+
entrypoint: source.workerEntry
|
|
90215
|
+
}
|
|
90216
|
+
})), () => PluginNotFoundError.make({ descriptor: `${params.kind}:${pluginUrl}` }));
|
|
90217
|
+
};
|
|
91615
90218
|
const ReporterStageTypeId = Symbol.for("@systemfsoftware/stryker-js/ReporterStage");
|
|
91616
90219
|
const carriesAttachments = (stage) => "attachments" in stage;
|
|
91617
90220
|
const makeReporterStage = (attachments) => {
|
|
@@ -91734,7 +90337,7 @@ const detachStalledReporter = (attachment) => logWarning(`Reporter "${attachment
|
|
|
91734
90337
|
})));
|
|
91735
90338
|
const offerToInbox = (attachment, event) => gen(function* () {
|
|
91736
90339
|
const offered = yield* offer(attachment.inbox, event).pipe(timeoutOption(REPORTER_STALL_TIMEOUT));
|
|
91737
|
-
return yield* match$
|
|
90340
|
+
return yield* match$6(offered, {
|
|
91738
90341
|
onNone: () => detachStalledReporter(attachment),
|
|
91739
90342
|
onSome: (accepted) => value(accepted).pipe(when(true, () => void_$1), orElse(() => warnEventDropped(attachment)))
|
|
91740
90343
|
});
|
|
@@ -91768,12 +90371,12 @@ const settleFailedAttachment = (attachment, cause) => gen(function* () {
|
|
|
91768
90371
|
});
|
|
91769
90372
|
const settleAttachment = (attachment) => gen(function* () {
|
|
91770
90373
|
const settled = yield* exit(join$1(attachment.consumer)).pipe(timeoutOption(REPORTER_STALL_TIMEOUT));
|
|
91771
|
-
return yield* match$
|
|
90374
|
+
return yield* match$6(settled, {
|
|
91772
90375
|
onNone: () => logWarning(`Reporter "${attachment.name}" did not finish draining for ${toSeconds(REPORTER_STALL_TIMEOUT)} seconds and was detached; exit code unchanged.`).pipe(as({
|
|
91773
90376
|
kind: "detached",
|
|
91774
90377
|
name: attachment.name
|
|
91775
90378
|
})),
|
|
91776
|
-
onSome: (exit) => match$
|
|
90379
|
+
onSome: (exit) => match$1(exit, {
|
|
91777
90380
|
onSuccess: () => succeed$4({
|
|
91778
90381
|
kind: "completed",
|
|
91779
90382
|
name: attachment.name
|
|
@@ -91917,17 +90520,21 @@ const dryRunCell = Cell_exports.layer({
|
|
|
91917
90520
|
const dryRunTimeout = command.options.dryRunTimeoutMinutes * 60 * 1e3;
|
|
91918
90521
|
yield* logInfo("Starting dry run");
|
|
91919
90522
|
const { rawResult, capabilities, gross } = yield* scoped(gen(function* () {
|
|
91920
|
-
const childRunnerEffect = suspend$3(() =>
|
|
91921
|
-
|
|
91922
|
-
|
|
91923
|
-
|
|
91924
|
-
|
|
91925
|
-
|
|
91926
|
-
|
|
91927
|
-
|
|
91928
|
-
|
|
91929
|
-
|
|
91930
|
-
|
|
90523
|
+
const childRunnerEffect = suspend$3(() => {
|
|
90524
|
+
const runnerConfigured = command.options.testRunner;
|
|
90525
|
+
const runnerLabel = value(runnerConfigured).pipe(when(isCustomTestRunner, (runner) => runner.plugin), orElse((name) => name));
|
|
90526
|
+
return resolveConfiguredWorkerSpawn({
|
|
90527
|
+
loaded: command.loadedPlugins,
|
|
90528
|
+
kind: "TestRunner",
|
|
90529
|
+
configured: runnerConfigured
|
|
90530
|
+
}).pipe(mapError(missingWorkerEntry("dryRun", "test runner", runnerLabel)), flatMap$1(({ spawn }) => makeChildProcessTestRunner({
|
|
90531
|
+
options: command.options,
|
|
90532
|
+
fileDescriptions: command.project.fileDescriptions,
|
|
90533
|
+
sandboxWorkingDirectory: command.sandbox.workingDirectory,
|
|
90534
|
+
workerEntrypoint: spawn.entrypoint,
|
|
90535
|
+
idGenerator
|
|
90536
|
+
})));
|
|
90537
|
+
});
|
|
91931
90538
|
const runner = yield* buildTestRunner({
|
|
91932
90539
|
options: command.options,
|
|
91933
90540
|
fileDescriptions: command.project.fileDescriptions,
|
|
@@ -91936,7 +90543,7 @@ const dryRunCell = Cell_exports.layer({
|
|
|
91936
90543
|
retire: void_$1,
|
|
91937
90544
|
testFiles: testFiles ?? []
|
|
91938
90545
|
}, childRunnerEffect);
|
|
91939
|
-
const extra = match$
|
|
90546
|
+
const extra = match$6(fromUndefinedOr(testFiles), {
|
|
91940
90547
|
onNone: () => ({}),
|
|
91941
90548
|
onSome: (files) => ({ testFiles: files })
|
|
91942
90549
|
});
|
|
@@ -98782,7 +97389,7 @@ function directiveOutcome(directive, lowerMutatorName, line) {
|
|
|
98782
97389
|
}
|
|
98783
97390
|
/** A directive applies when its line — where it declares one — and one of its mutator names match. */
|
|
98784
97391
|
function directiveApplies(directive, lowerMutatorName, line) {
|
|
98785
|
-
return match$
|
|
97392
|
+
return match$6(fromNullishOr(directive.line), {
|
|
98786
97393
|
onNone: () => true,
|
|
98787
97394
|
onSome: (directiveLine) => directiveLine === line
|
|
98788
97395
|
}) && directive.mutatorNames.some((name) => name === lowerMutatorName || name === WILDCARD);
|
|
@@ -98850,7 +97457,7 @@ function mutatorWarnings(directive, allMutatorNames, originFileName) {
|
|
|
98850
97457
|
}
|
|
98851
97458
|
function mutatorWarning(directive, mutatorName, originFileName) {
|
|
98852
97459
|
const loc = commentLocation(directive.loc);
|
|
98853
|
-
return `Unused 'Stryker ${match$
|
|
97460
|
+
return `Unused 'Stryker ${match$6(filter$2(fromNullishOr(directive.scope), (scope) => scope !== ""), {
|
|
98854
97461
|
onNone: () => directive.type,
|
|
98855
97462
|
onSome: (scope) => `${directive.type} ${scope}`
|
|
98856
97463
|
})}' directive. Mutator with name '${mutatorName}' not found. Directive found at: ${originFileName}:${loc.start.line}:${loc.start.column}.`;
|
|
@@ -98926,7 +97533,7 @@ function throwPlacementError(error, nodePath, placer, mutants, fileName, lineTab
|
|
|
98926
97533
|
function placementLocation(node, fileName, lineTable, basePath) {
|
|
98927
97534
|
const relativeFile = basePath === void 0 ? fileName : relativeTo(basePath, fileName);
|
|
98928
97535
|
const position = map$12(fromNullishOr(spanOf(node)), (span) => positionFromLineTable(span.start, lineTable));
|
|
98929
|
-
return match$
|
|
97536
|
+
return match$6(position, {
|
|
98930
97537
|
onNone: () => `${relativeFile}:undefined:undefined`,
|
|
98931
97538
|
onSome: (at) => `${relativeFile}:${at.line}:${at.column}`
|
|
98932
97539
|
});
|
|
@@ -98970,7 +97577,7 @@ function arrowFunctionExpressionNamedIfNeeded(path) {
|
|
|
98970
97577
|
}
|
|
98971
97578
|
/** An arrow bound to a named declaration is re-emitted as a named function. */
|
|
98972
97579
|
function arrowNamedByDeclarator(node, parentPath) {
|
|
98973
|
-
return match$
|
|
97580
|
+
return match$6(declaratorIdentifier(parentPath), {
|
|
98974
97581
|
onNone: () => void 0,
|
|
98975
97582
|
onSome: (identifier) => namedArrowExpression(node, identifier)
|
|
98976
97583
|
});
|
|
@@ -98985,7 +97592,7 @@ function isVariableDeclarator(node) {
|
|
|
98985
97592
|
return nodeType(node) === "VariableDeclarator";
|
|
98986
97593
|
}
|
|
98987
97594
|
function adoptDeclaredName(node, declarator) {
|
|
98988
|
-
return match$
|
|
97595
|
+
return match$6(declaredName(declarator), {
|
|
98989
97596
|
onNone: () => void 0,
|
|
98990
97597
|
onSome: (identifier) => adoptIdentifier(node, identifier)
|
|
98991
97598
|
});
|
|
@@ -99071,7 +97678,7 @@ function unwrapParenthesizedExpression(node) {
|
|
|
99071
97678
|
return getOrElse(innerExpression(node), () => node);
|
|
99072
97679
|
}
|
|
99073
97680
|
function innerExpression(node) {
|
|
99074
|
-
return flatMap$5(filter$
|
|
97681
|
+
return flatMap$5(filter$2(some(node), isParenthesizedWrapper), (parenthesized) => map$12(fromNullishOr(parenthesized.expression), unwrapParenthesizedExpression));
|
|
99075
97682
|
}
|
|
99076
97683
|
function isParenthesizedWrapper(value) {
|
|
99077
97684
|
return hasProperty(value, "type") && value["type"] === "ParenthesizedExpression";
|
|
@@ -99194,13 +97801,13 @@ const placeHeader = (root) => map$7(headerFor(root), (header) => {
|
|
|
99194
97801
|
function shouldPlaceHeader(mutantCollector, originFileName, options) {
|
|
99195
97802
|
return hasPlacedMutants(mutantCollector, originFileName) && options.noHeader !== true;
|
|
99196
97803
|
}
|
|
99197
|
-
const headerFor = (root) => map$7(instrumentationHeader, (header) => match$
|
|
97804
|
+
const headerFor = (root) => map$7(instrumentationHeader, (header) => match$6(leadingCommentsOf(root), {
|
|
99198
97805
|
onNone: () => header,
|
|
99199
97806
|
onSome: (leadingComments) => [commentedHeader(leadingComments, header), ...header.slice(1)]
|
|
99200
97807
|
}));
|
|
99201
97808
|
function leadingCommentsOf(root) {
|
|
99202
97809
|
const firstStatement = root.body[0];
|
|
99203
|
-
return filter$
|
|
97810
|
+
return filter$2(fromNullishOr(firstStatement?.leadingComments), isCommentArray);
|
|
99204
97811
|
}
|
|
99205
97812
|
function commentedHeader(leadingComments, header) {
|
|
99206
97813
|
const cloned = cloneNode(getOrThrowWith(fromNullishOr(header[0]), () => /* @__PURE__ */ new Error("Instrumentation header is empty")));
|
|
@@ -99208,13 +97815,13 @@ function commentedHeader(leadingComments, header) {
|
|
|
99208
97815
|
return cloned;
|
|
99209
97816
|
}
|
|
99210
97817
|
function deepFreeze(value) {
|
|
99211
|
-
return match$
|
|
97818
|
+
return match$6(frozenContainer(value), {
|
|
99212
97819
|
onNone: () => value,
|
|
99213
97820
|
onSome: (frozen) => frozen
|
|
99214
97821
|
});
|
|
99215
97822
|
}
|
|
99216
97823
|
function frozenContainer(value) {
|
|
99217
|
-
return map$12(filter$
|
|
97824
|
+
return map$12(filter$2(some(value), isObjectValue), (object) => {
|
|
99218
97825
|
freezableChildren(object).forEach((child) => {
|
|
99219
97826
|
deepFreeze(child);
|
|
99220
97827
|
});
|
|
@@ -99229,10 +97836,10 @@ function freezableChildren(value) {
|
|
|
99229
97836
|
];
|
|
99230
97837
|
}
|
|
99231
97838
|
function mapEntries(value) {
|
|
99232
|
-
return getOrElse(map$12(filter$
|
|
97839
|
+
return getOrElse(map$12(filter$2(some(value), isMap), (map) => [...map.entries()].flat()), () => NO_CHILDREN);
|
|
99233
97840
|
}
|
|
99234
97841
|
function setItems(value) {
|
|
99235
|
-
return getOrElse(map$12(filter$
|
|
97842
|
+
return getOrElse(map$12(filter$2(some(value), isSet), (set) => [...set]), () => NO_CHILDREN);
|
|
99236
97843
|
}
|
|
99237
97844
|
function isObjectValue(value) {
|
|
99238
97845
|
return value !== null && typeof value === "object";
|
|
@@ -99393,7 +98000,7 @@ const transformScript = ({ root, originFileName, rawContent, offset, comments },
|
|
|
99393
98000
|
].some((skip) => skip);
|
|
99394
98001
|
}
|
|
99395
98002
|
function mutateRanges() {
|
|
99396
|
-
return filter$
|
|
98003
|
+
return filter$2(some(mutateDescription), isMutateRangeList);
|
|
99397
98004
|
}
|
|
99398
98005
|
function isOutsideMutateRanges(path) {
|
|
99399
98006
|
return exists$1(mutateRanges(), (ranges) => ranges.every((range) => !locationOverlaps(range, getNodeLocation(path.node))));
|
|
@@ -99861,16 +98468,16 @@ function createPureMatcher(pattern, allowHiddenFiles, basePath) {
|
|
|
99861
98468
|
return value(isExcludedHiddenFile(normalizedFile, base, allowHiddenFiles, patternHasDot)).pipe(when(true, () => false), orElse(() => regex.test(normalizedFile)));
|
|
99862
98469
|
};
|
|
99863
98470
|
}
|
|
99864
|
-
const rangeListOf = (mutate) => filter$
|
|
98471
|
+
const rangeListOf = (mutate) => filter$2(fromUndefinedOr(mutate), Array.isArray);
|
|
99865
98472
|
function unionPair(first, second) {
|
|
99866
98473
|
const ranges = all$2([rangeListOf(first.mutate), rangeListOf(second.mutate)]);
|
|
99867
|
-
return match$
|
|
98474
|
+
return match$6(ranges, {
|
|
99868
98475
|
onSome: ([firstRanges, secondRanges]) => ({ mutate: [...secondRanges, ...firstRanges] }),
|
|
99869
98476
|
onNone: () => value(second.mutate).pipe(when(true, () => ({ mutate: true })), orElse(() => value(first.mutate).pipe(when(false, () => ({ mutate: second.mutate })), orElse(() => ({ mutate: first.mutate })))))
|
|
99870
98477
|
});
|
|
99871
98478
|
}
|
|
99872
98479
|
function unionFileDescriptions(first, second) {
|
|
99873
|
-
return match$
|
|
98480
|
+
return match$6(fromUndefinedOr(second), {
|
|
99874
98481
|
onNone: () => first,
|
|
99875
98482
|
onSome: (defined) => unionPair(first, defined)
|
|
99876
98483
|
});
|
|
@@ -99897,7 +98504,7 @@ function overlapRanges(firstRanges, secondRanges) {
|
|
|
99897
98504
|
}
|
|
99898
98505
|
function intersectFileDescriptions(first, second) {
|
|
99899
98506
|
const ranges = all$2([rangeListOf(first.mutate), rangeListOf(second.mutate)]);
|
|
99900
|
-
return match$
|
|
98507
|
+
return match$6(ranges, {
|
|
99901
98508
|
onSome: ([firstRanges, secondRanges]) => ({ mutate: overlapRanges(firstRanges, secondRanges) }),
|
|
99902
98509
|
onNone: () => value(first.mutate).pipe(when(true, () => second), orElse(() => value(second.mutate).pipe(when(true, () => first), orElse(() => ({ mutate: false })))))
|
|
99903
98510
|
});
|
|
@@ -99954,7 +98561,7 @@ function resolveFileDescriptionsPure(inputFileNames, mutatePatterns, targetMutat
|
|
|
99954
98561
|
if (targetMutatePatterns !== void 0) {
|
|
99955
98562
|
const seen = targetMutatePatterns.reduce((acc, pattern) => {
|
|
99956
98563
|
const files = filterMutatePatternPure(keys(afterMutate), pattern, basePath);
|
|
99957
|
-
return reduce(files, acc, (inner, description, fileName) => match$
|
|
98564
|
+
return reduce(files, acc, (inner, description, fileName) => match$6(get$3(afterMutate, fileName), {
|
|
99958
98565
|
onNone: () => inner,
|
|
99959
98566
|
onSome: (current) => {
|
|
99960
98567
|
const intersected = intersectFileDescriptions(current, description);
|
|
@@ -99995,7 +98602,7 @@ const toLocation = (location) => ({
|
|
|
99995
98602
|
start: toPosition(location.start),
|
|
99996
98603
|
end: toPosition(location.end)
|
|
99997
98604
|
});
|
|
99998
|
-
const toOpenEndLocation = (location) => match$
|
|
98605
|
+
const toOpenEndLocation = (location) => match$6(fromUndefinedOr(location.end), {
|
|
99999
98606
|
onNone: () => ({ start: toPosition(location.start) }),
|
|
100000
98607
|
onSome: (end) => ({
|
|
100001
98608
|
start: toPosition(location.start),
|
|
@@ -100011,7 +98618,7 @@ const withMappedMutantLocations = (report) => Object.fromEntries(Object.entries(
|
|
|
100011
98618
|
}]));
|
|
100012
98619
|
const withMappedTestLocations = (testFiles) => Object.fromEntries(Object.entries(testFiles).map(([fileName, file]) => [fileName, {
|
|
100013
98620
|
...file,
|
|
100014
|
-
tests: file.tests.map((test) => match$
|
|
98621
|
+
tests: file.tests.map((test) => match$6(fromUndefinedOr(test.location), {
|
|
100015
98622
|
onNone: () => ({ ...test }),
|
|
100016
98623
|
onSome: (location) => ({
|
|
100017
98624
|
...test,
|
|
@@ -100019,7 +98626,7 @@ const withMappedTestLocations = (testFiles) => Object.fromEntries(Object.entries
|
|
|
100019
98626
|
})
|
|
100020
98627
|
}))
|
|
100021
98628
|
}]));
|
|
100022
|
-
const reshape = (decoded) => match$
|
|
98629
|
+
const reshape = (decoded) => match$6(fromUndefinedOr(decoded.testFiles), {
|
|
100023
98630
|
onNone: () => ({
|
|
100024
98631
|
...decoded,
|
|
100025
98632
|
files: withMappedMutantLocations(decoded)
|
|
@@ -100030,7 +98637,7 @@ const reshape = (decoded) => match$7(fromUndefinedOr(decoded.testFiles), {
|
|
|
100030
98637
|
testFiles: withMappedTestLocations(testFiles)
|
|
100031
98638
|
})
|
|
100032
98639
|
});
|
|
100033
|
-
const decodeIncrementalReport = (raw) => match$
|
|
98640
|
+
const decodeIncrementalReport = (raw) => match$5(decodeUnknownResult(IncrementalReportSchema)(raw), {
|
|
100034
98641
|
onFailure: () => fail$4(IncrementalReportError.make({ message: "The incremental report is not a mutation testing report; delete it or re-run without --incremental." })),
|
|
100035
98642
|
onSuccess: (decoded) => succeed$8(reshape(decoded))
|
|
100036
98643
|
});
|
|
@@ -100064,7 +98671,7 @@ function toInstrumenterFile(file) {
|
|
|
100064
98671
|
}
|
|
100065
98672
|
function readContent(file) {
|
|
100066
98673
|
const inMemory = orElse$2(fromUndefinedOr(file.content), () => fromUndefinedOr(file.originalContent));
|
|
100067
|
-
return match$
|
|
98674
|
+
return match$6(inMemory, {
|
|
100068
98675
|
onSome: (content) => succeed$4(content),
|
|
100069
98676
|
onNone: () => gen(function* () {
|
|
100070
98677
|
return yield* (yield* FileSystem).readFileString(file.name);
|
|
@@ -100077,8 +98684,8 @@ function readOriginal(file) {
|
|
|
100077
98684
|
});
|
|
100078
98685
|
}
|
|
100079
98686
|
function writeInPlace(file) {
|
|
100080
|
-
const content = filter$
|
|
100081
|
-
return match$
|
|
98687
|
+
const content = filter$2(fromUndefinedOr(file.content), () => hasChanges(file));
|
|
98688
|
+
return match$6(content, {
|
|
100082
98689
|
onNone: () => void_$1,
|
|
100083
98690
|
onSome: (text) => gen(function* () {
|
|
100084
98691
|
yield* (yield* FileSystem).writeFileString(file.name, text);
|
|
@@ -100140,7 +98747,7 @@ function withFile(project, file) {
|
|
|
100140
98747
|
}
|
|
100141
98748
|
function withInstrumentedFiles(project, instrumented) {
|
|
100142
98749
|
let next = project;
|
|
100143
|
-
for (const { name, content } of instrumented) match$
|
|
98750
|
+
for (const { name, content } of instrumented) match$6(get$7(next.files, name), {
|
|
100144
98751
|
onNone: () => void 0,
|
|
100145
98752
|
onSome: (existing) => {
|
|
100146
98753
|
next = withFile(next, withContent(existing, content));
|
|
@@ -100153,18 +98760,14 @@ function resolveInputFileNames(ignoreRules, basePath) {
|
|
|
100153
98760
|
return gen(function* () {
|
|
100154
98761
|
const fs = yield* FileSystem;
|
|
100155
98762
|
const pathService = yield* Path;
|
|
100156
|
-
const ignoreMatchers = ignoreRules.map(
|
|
100157
|
-
|
|
100158
|
-
flipNegate: true,
|
|
100159
|
-
nocase: true
|
|
100160
|
-
}));
|
|
100161
|
-
const matchesDirectoryPartially = (entryPath, rule) => rule.match(`/${entryPath}`, true) || rule.match(entryPath, true);
|
|
98763
|
+
const ignoreMatchers = ignoreRules.map(compileIgnoreRule);
|
|
98764
|
+
const matchesDirectoryPartially = (entryPath, rule) => rule.matchesPrefix(`/${entryPath}`) || rule.matchesPrefix(entryPath);
|
|
100162
98765
|
const matchesFile = (entryName, entryPath, rule) => [
|
|
100163
98766
|
entryName,
|
|
100164
98767
|
entryPath,
|
|
100165
98768
|
`/${entryPath}`
|
|
100166
|
-
].some((candidate) => rule.
|
|
100167
|
-
const matchesDirectoryTail = (entryPath, rule) => [rule.
|
|
98769
|
+
].some((candidate) => rule.matches(candidate));
|
|
98770
|
+
const matchesDirectoryTail = (entryPath, rule) => [rule.matches(`/${entryPath}/`), rule.matches(`${entryPath}/`)].some((matched) => matched);
|
|
100168
98771
|
const matchesNegatedDirectory = (entryPath, rule) => rule.negate && matchesDirectoryPartially(entryPath, rule);
|
|
100169
98772
|
const matchesDirectory = (entryName, entryPath, rule) => [
|
|
100170
98773
|
matchesFile(entryName, entryPath, rule),
|
|
@@ -100196,7 +98799,7 @@ function resolveInputFileNames(ignoreRules, basePath) {
|
|
|
100196
98799
|
});
|
|
100197
98800
|
}
|
|
100198
98801
|
function parseIncrementalReport(contents) {
|
|
100199
|
-
return match$
|
|
98802
|
+
return match$6(fromUndefinedOr(contents), {
|
|
100200
98803
|
onNone: () => succeedNone,
|
|
100201
98804
|
onSome: (text) => gen(function* () {
|
|
100202
98805
|
const parsed = yield* try_(() => parseJson(text));
|
|
@@ -100493,7 +99096,11 @@ const DEFAULT_GLOB = "**/*.{js,ts,jsx,tsx,html,vue,mjs,mts,cts,cjs}";
|
|
|
100493
99096
|
const normalizeFileName$1 = (fileName) => fileName.replace(/\\/g, "/");
|
|
100494
99097
|
const normalizePattern = (pattern, pathService) => value(pattern).pipe(when(string$5, (value) => normalizeFileName$1(pathService.resolve(value))), when(true, () => DEFAULT_GLOB), orElse(() => false));
|
|
100495
99098
|
function createFileMatcher(pattern, pathService, allowHiddenFiles = true) {
|
|
100496
|
-
return value(normalizePattern(pattern, pathService)).pipe(when(string$5, (normalized) => (fileName) =>
|
|
99099
|
+
return value(normalizePattern(pattern, pathService)).pipe(when(string$5, (normalized) => (fileName) => {
|
|
99100
|
+
const path = normalizeFileName$1(pathService.resolve(fileName));
|
|
99101
|
+
const hidden = path.split("/").some((segment) => segment.startsWith("."));
|
|
99102
|
+
return value(allowHiddenFiles || !hidden).pipe(when(true, () => matchesGlob(path, normalized)), orElse(() => false));
|
|
99103
|
+
}), orElse((normalized) => () => normalized));
|
|
100497
99104
|
}
|
|
100498
99105
|
TaggedError()("BuildCommandFailedError", {
|
|
100499
99106
|
command: String$1,
|
|
@@ -100589,7 +99196,7 @@ const parseJsonText = (jsonText) => {
|
|
|
100589
99196
|
};
|
|
100590
99197
|
const parseTsConfigShape = (fileName, parsed) => value(parsed).pipe(when(is$2(TsConfigSchema), (config) => succeed$8(config)), orElse(() => fail$4(tsConfigParseError(fileName, `parsed to ${JSON.stringify(parsed)}, which does not match the tsconfig shape this package consumes`))));
|
|
100591
99198
|
function parseTsConfig(fileName, jsonText) {
|
|
100592
|
-
return match$
|
|
99199
|
+
return match$5(parseJsonText(jsonText), {
|
|
100593
99200
|
onFailure: (reason) => fail$4(tsConfigParseError(fileName, reason)),
|
|
100594
99201
|
onSuccess: (parsed) => parseTsConfigShape(fileName, parsed)
|
|
100595
99202
|
});
|
|
@@ -101035,7 +99642,7 @@ const skippedRequested = (command, acknowledged) => liftPredicate(isReadonlyArra
|
|
|
101035
99642
|
})));
|
|
101036
99643
|
/** The first contract breach the answer commits: an unrequested id outranks an unanswered one. */
|
|
101037
99644
|
const contractBreach = (command, requested, submitted) => firstSomeOf([answeredUnrequested(command, submitted, requested), skippedRequested(command, acknowledgedIds(submitted, requested))]);
|
|
101038
|
-
const admit = (command, requested, submitted, decision) => match$
|
|
99645
|
+
const admit = (command, requested, submitted, decision) => match$6(contractBreach(command, requested, submitted), {
|
|
101039
99646
|
onNone: () => succeed$8(decision),
|
|
101040
99647
|
onSome: (breach) => fail$4(breach)
|
|
101041
99648
|
});
|
|
@@ -101109,11 +99716,11 @@ const partitionAnswers = (byId, answers) => {
|
|
|
101109
99716
|
plan: fromUndefinedOr(byId.get(id))
|
|
101110
99717
|
}));
|
|
101111
99718
|
return {
|
|
101112
|
-
paired: entries.flatMap((entry) => match$
|
|
99719
|
+
paired: entries.flatMap((entry) => match$6(entry.plan, {
|
|
101113
99720
|
onNone: () => [],
|
|
101114
99721
|
onSome: (plan) => [[plan, entry.answer]]
|
|
101115
99722
|
})),
|
|
101116
|
-
unrequested: entries.flatMap((entry) => match$
|
|
99723
|
+
unrequested: entries.flatMap((entry) => match$6(entry.plan, {
|
|
101117
99724
|
onNone: () => [entry.id],
|
|
101118
99725
|
onSome: () => []
|
|
101119
99726
|
}))
|
|
@@ -101130,12 +99737,12 @@ const partitionGroupIds = (byId, idGroup) => {
|
|
|
101130
99737
|
plan: fromUndefinedOr(byId.get(id))
|
|
101131
99738
|
}));
|
|
101132
99739
|
return {
|
|
101133
|
-
plans: entries.flatMap((entry) => match$
|
|
99740
|
+
plans: entries.flatMap((entry) => match$6(entry.plan, {
|
|
101134
99741
|
onNone: () => [],
|
|
101135
99742
|
onSome: (plan) => [plan]
|
|
101136
99743
|
})),
|
|
101137
99744
|
grouped: new Set(idGroup),
|
|
101138
|
-
unrequested: entries.flatMap((entry) => match$
|
|
99745
|
+
unrequested: entries.flatMap((entry) => match$6(entry.plan, {
|
|
101139
99746
|
onNone: () => [entry.id],
|
|
101140
99747
|
onSome: () => []
|
|
101141
99748
|
}))
|
|
@@ -101188,7 +99795,7 @@ const createCheckerFactory = (options, fileDescriptions, workerEntrypoint, idGen
|
|
|
101188
99795
|
fileDescriptions,
|
|
101189
99796
|
workerEntrypoint,
|
|
101190
99797
|
workingDirectory,
|
|
101191
|
-
execArgv: [...options.checkerNodeArgs],
|
|
99798
|
+
execArgv: [...value(options.checkers[0]?.nodeArgs).pipe(when(_undefined, () => options.checkerNodeArgs), orElse((args) => args))],
|
|
101192
99799
|
idGenerator
|
|
101193
99800
|
});
|
|
101194
99801
|
const writeDecidedAnswers = (plans, checkerName, answers) => fromResult(pairCheckResults(checkerName, plans, Object.fromEntries(answers.map((answer) => [answer.id, answer.result]))));
|
|
@@ -101198,7 +99805,7 @@ const writeCheckerDecision = (plans, checkerName, decision) => value(decision).p
|
|
|
101198
99805
|
phase: "check",
|
|
101199
99806
|
missingIds: []
|
|
101200
99807
|
}))), exhaustive);
|
|
101201
|
-
const writeCheckerOutcome = (plans, checkerName, outcome) => match$
|
|
99808
|
+
const writeCheckerOutcome = (plans, checkerName, outcome) => match$5(outcome, {
|
|
101202
99809
|
onFailure: (error) => fail(error),
|
|
101203
99810
|
onSuccess: (decision) => writeCheckerDecision(plans, checkerName, decision)
|
|
101204
99811
|
});
|
|
@@ -101207,7 +99814,7 @@ const writeGroupDecision = (plans, checkerName, decision) => value(decision).pip
|
|
|
101207
99814
|
phase: "group",
|
|
101208
99815
|
missingIds: []
|
|
101209
99816
|
}))), exhaustive);
|
|
101210
|
-
const writeGroupOutcome = (plans, checkerName, outcome) => match$
|
|
99817
|
+
const writeGroupOutcome = (plans, checkerName, outcome) => match$5(outcome, {
|
|
101211
99818
|
onFailure: (error) => fail(error),
|
|
101212
99819
|
onSuccess: (decision) => writeGroupDecision(plans, checkerName, decision)
|
|
101213
99820
|
});
|
|
@@ -101318,7 +99925,7 @@ const EXTENSION_LANGUAGES = {
|
|
|
101318
99925
|
".vue": "html"
|
|
101319
99926
|
};
|
|
101320
99927
|
const determineLanguage = (fileName) => EXTENSION_LANGUAGES[extensionOf(fileName)] ?? "javascript";
|
|
101321
|
-
const reportFileName = (relativePath) => match$
|
|
99928
|
+
const reportFileName = (relativePath) => match$6(fromUndefinedOr(relativePath), {
|
|
101322
99929
|
onNone: () => "",
|
|
101323
99930
|
onSome: (present) => present.replaceAll("\\", "/")
|
|
101324
99931
|
});
|
|
@@ -101359,11 +99966,11 @@ const toReportTest = (test, remap) => {
|
|
|
101359
99966
|
};
|
|
101360
99967
|
};
|
|
101361
99968
|
const assembleFileResults = (input) => {
|
|
101362
|
-
const entries = [...input.mutants.reduce((accumulator, mutant) => match$
|
|
99969
|
+
const entries = [...input.mutants.reduce((accumulator, mutant) => match$6(get$3(input.reportNames, mutant.fileName), {
|
|
101363
99970
|
onNone: () => accumulator,
|
|
101364
99971
|
onSome: (reportName) => {
|
|
101365
99972
|
const mapped = toReportMutant(mutant, input.remap);
|
|
101366
|
-
return match$
|
|
99973
|
+
return match$6(get$3(accumulator, reportName), {
|
|
101367
99974
|
onNone: () => set$2(accumulator, reportName, {
|
|
101368
99975
|
sourceFileName: mutant.fileName,
|
|
101369
99976
|
mutants: [mapped]
|
|
@@ -101374,7 +99981,7 @@ const assembleFileResults = (input) => {
|
|
|
101374
99981
|
})
|
|
101375
99982
|
});
|
|
101376
99983
|
}
|
|
101377
|
-
}), empty$2())].flatMap(([reportName, group]) => match$
|
|
99984
|
+
}), empty$2())].flatMap(([reportName, group]) => match$6(get$3(input.sources, group.sourceFileName), {
|
|
101378
99985
|
onNone: () => [],
|
|
101379
99986
|
onSome: (source) => [[reportName, {
|
|
101380
99987
|
...source,
|
|
@@ -101384,13 +99991,13 @@ const assembleFileResults = (input) => {
|
|
|
101384
99991
|
return Object.fromEntries(entries);
|
|
101385
99992
|
};
|
|
101386
99993
|
const assembleTestFiles = (input) => {
|
|
101387
|
-
const entries = [...input.tests.reduce((accumulator, test) => match$
|
|
99994
|
+
const entries = [...input.tests.reduce((accumulator, test) => match$6(fromUndefinedOr(test.fileName), {
|
|
101388
99995
|
onNone: () => accumulator,
|
|
101389
|
-
onSome: (testFileName) => match$
|
|
99996
|
+
onSome: (testFileName) => match$6(get$3(input.reportNames, testFileName), {
|
|
101390
99997
|
onNone: () => accumulator,
|
|
101391
99998
|
onSome: (reportName) => {
|
|
101392
99999
|
const mapped = toReportTest(test, input.remap);
|
|
101393
|
-
return match$
|
|
100000
|
+
return match$6(get$3(accumulator, reportName), {
|
|
101394
100001
|
onNone: () => set$2(accumulator, reportName, {
|
|
101395
100002
|
sourceFileName: testFileName,
|
|
101396
100003
|
tests: [mapped]
|
|
@@ -101402,7 +100009,7 @@ const assembleTestFiles = (input) => {
|
|
|
101402
100009
|
});
|
|
101403
100010
|
}
|
|
101404
100011
|
})
|
|
101405
|
-
}), empty$2())].flatMap(([reportName, group]) => match$
|
|
100012
|
+
}), empty$2())].flatMap(([reportName, group]) => match$6(get$3(input.testSources, group.sourceFileName), {
|
|
101406
100013
|
onNone: () => [],
|
|
101407
100014
|
onSome: (source) => [[reportName, {
|
|
101408
100015
|
...source,
|
|
@@ -101775,7 +100382,7 @@ function buildVerdictEnvelope(report, mode, signal, runId, basePath, pathService
|
|
|
101775
100382
|
runId,
|
|
101776
100383
|
mode,
|
|
101777
100384
|
signal,
|
|
101778
|
-
score: getOrNull(filter$
|
|
100385
|
+
score: getOrNull(filter$2(some(metrics.mutationScore), (score) => metrics.totalMutants > 0 && Number.isFinite(score))),
|
|
101779
100386
|
thresholds: {
|
|
101780
100387
|
high: report.thresholds.high,
|
|
101781
100388
|
low: report.thresholds.low,
|
|
@@ -101791,7 +100398,7 @@ function buildVerdictEnvelope(report, mode, signal, runId, basePath, pathService
|
|
|
101791
100398
|
ignored: metrics.ignored,
|
|
101792
100399
|
pending: metrics.pending
|
|
101793
100400
|
},
|
|
101794
|
-
reportFile: getOrNull(map$12(filter$
|
|
100401
|
+
reportFile: getOrNull(map$12(filter$2(fromUndefinedOr(jsonReporterFileName), () => metrics.totalMutants > 0), (fileName) => normalizeFileName(pathService.relative(basePath, fileName)))),
|
|
101795
100402
|
mutants: actionableMutants(report.files)
|
|
101796
100403
|
};
|
|
101797
100404
|
}
|
|
@@ -101930,7 +100537,7 @@ const makeMutationReportingService = (input) => {
|
|
|
101930
100537
|
const resolved = yield* try_(() => new URL(import.meta.resolve(`${specifier}/package.json`)));
|
|
101931
100538
|
const manifestPath = yield* pathService.fromFileUrl(resolved);
|
|
101932
100539
|
const text = yield* fs.readFileString(manifestPath);
|
|
101933
|
-
return match$
|
|
100540
|
+
return match$5(decodeUnknownResult(fromJsonString(ManifestSchema))(text), {
|
|
101934
100541
|
onFailure: () => none(),
|
|
101935
100542
|
onSuccess: (manifest) => some(manifest.version ?? "")
|
|
101936
100543
|
});
|
|
@@ -101939,7 +100546,7 @@ const makeMutationReportingService = (input) => {
|
|
|
101939
100546
|
const fs = yield* FileSystem;
|
|
101940
100547
|
const pathService = yield* Path;
|
|
101941
100548
|
const pairs = yield* forEach$1(MANIFEST_SPECIFIERS, (specifier) => map$7(readManifestVersion(fs, pathService, specifier), (version) => [specifier, version]), { concurrency: 24 });
|
|
101942
|
-
return Object.fromEntries(pairs.flatMap(([specifier, version]) => match$
|
|
100549
|
+
return Object.fromEntries(pairs.flatMap(([specifier, version]) => match$6(version, {
|
|
101943
100550
|
onNone: () => [],
|
|
101944
100551
|
onSome: (present) => [[specifier, present]]
|
|
101945
100552
|
})));
|
|
@@ -102028,11 +100635,11 @@ const readCurrentRelativeFiles = (project, basePath) => gen(function* () {
|
|
|
102028
100635
|
const entries = yield* forEach$1(values$2(project.files), (file) => map$7(readOriginal(file), (content) => [toRelativeNormalizedFileName(file.name, basePath), content]), { concurrency: 24 });
|
|
102029
100636
|
return Object.fromEntries(entries);
|
|
102030
100637
|
});
|
|
102031
|
-
const rememberedCoveredBy = (entry) => match$
|
|
100638
|
+
const rememberedCoveredBy = (entry) => match$6(fromNullishOr(entry.coveredBy), {
|
|
102032
100639
|
onNone: () => ({}),
|
|
102033
100640
|
onSome: (coveredBy) => ({ coveredBy: [...coveredBy] })
|
|
102034
100641
|
});
|
|
102035
|
-
const rememberedKilledBy = (entry) => match$
|
|
100642
|
+
const rememberedKilledBy = (entry) => match$6(fromNullishOr(entry.killedBy), {
|
|
102036
100643
|
onNone: () => ({}),
|
|
102037
100644
|
onSome: (killedBy) => ({ killedBy: [...killedBy] })
|
|
102038
100645
|
});
|
|
@@ -102048,7 +100655,7 @@ const rememberedResultOf = (mutant, entry) => Object.assign({}, mutant, {
|
|
|
102048
100655
|
}, rememberedCoverage(entry));
|
|
102049
100656
|
const rememberedResultsOf = (mutants, remembered) => {
|
|
102050
100657
|
const byId = new Map(mutants.map((mutant) => [mutant.id, mutant]));
|
|
102051
|
-
return remembered.flatMap((entry) => match$
|
|
100658
|
+
return remembered.flatMap((entry) => match$6(fromNullishOr(byId.get(entry.mutantId)), {
|
|
102052
100659
|
onNone: () => [],
|
|
102053
100660
|
onSome: (mutant) => [rememberedResultOf(mutant, entry)]
|
|
102054
100661
|
}));
|
|
@@ -102089,40 +100696,38 @@ const toReportedMutant = (mutant) => Object.assign(mutant, {
|
|
|
102089
100696
|
coveredBy: mutant.coveredBy,
|
|
102090
100697
|
static: mutant.static
|
|
102091
100698
|
});
|
|
102092
|
-
const makeCheckerPool = (prev, idGenerator) =>
|
|
102093
|
-
|
|
102094
|
-
|
|
102095
|
-
|
|
102096
|
-
|
|
102097
|
-
|
|
102098
|
-
|
|
102099
|
-
|
|
102100
|
-
|
|
102101
|
-
|
|
102102
|
-
|
|
102103
|
-
|
|
102104
|
-
|
|
100699
|
+
const makeCheckerPool = (prev, idGenerator) => value(prev.options.checkers.length === 0).pipe(when(true, () => as(void_$1, void 0)), orElse(() => make$10({
|
|
100700
|
+
acquire: forEach$1(prev.options.checkers, (checker) => gen(function* () {
|
|
100701
|
+
const resolved = yield* resolveConfiguredWorkerSpawn({
|
|
100702
|
+
loaded: prev.loadedPlugins,
|
|
100703
|
+
kind: "Checker",
|
|
100704
|
+
configured: checker
|
|
100705
|
+
}).pipe(mapError(missingWorkerEntry("mutationTest", "checker", checker.plugin)));
|
|
100706
|
+
const service = yield* createCheckerFactory({
|
|
100707
|
+
...prev.options,
|
|
100708
|
+
checkers: [checker]
|
|
100709
|
+
}, prev.project.fileDescriptions, resolved.spawn.entrypoint, idGenerator, prev.sandbox.workingDirectory);
|
|
100710
|
+
return {
|
|
100711
|
+
checkerName: resolved.name,
|
|
100712
|
+
checker: service
|
|
100713
|
+
};
|
|
100714
|
+
})),
|
|
100715
|
+
size: prev.concurrency.checkers
|
|
100716
|
+
})));
|
|
102105
100717
|
const passedCheck = (result) => result.status === "passed";
|
|
102106
100718
|
const reportCheckOutcome = ([plan, result], reporting) => value(result).pipe(when(passedCheck, () => void_$1), orElse((failed) => reporting.reportCheckFailure(toReportedMutant(plan.mutant), failed).pipe(asVoid)));
|
|
102107
|
-
const
|
|
102108
|
-
const checked = yield* scoped(flatMap$1(get$2(checkerPool), (checker) => checkGroupedPlans(checker, checkerName, plans).pipe(catchTags({
|
|
102109
|
-
OutOfMemoryError: (error) => flatMap$1(invalidate(checkerPool, checker), () => fail(error)),
|
|
102110
|
-
ChildProcessCrashedError: (error) => flatMap$1(invalidate(checkerPool, checker), () => fail(error))
|
|
102111
|
-
}))));
|
|
102112
|
-
yield* forEach$1(checked, (pair) => reportCheckOutcome(pair, reporting), {
|
|
102113
|
-
concurrency: 1,
|
|
102114
|
-
discard: true
|
|
102115
|
-
});
|
|
102116
|
-
return checked.filter(([, result]) => result.status === "passed").map(([plan]) => plan);
|
|
102117
|
-
});
|
|
102118
|
-
const checkPlansWithEachChecker = (prev, checkerPool, plans, reporting) => gen(function* () {
|
|
102119
|
-
let passed = plans;
|
|
102120
|
-
for (const checkerName of prev.options.checkers) passed = yield* checkPlansWithOneChecker(checkerPool, checkerName, passed, reporting);
|
|
102121
|
-
return passed;
|
|
102122
|
-
});
|
|
102123
|
-
const checkPlansWithConfiguredCheckers = (prev, checkerPool, plans, reporting) => match$7(fromNullishOr(checkerPool), {
|
|
100719
|
+
const checkPlansWithConfiguredCheckers = (checkerPool, plans, reporting) => match$6(fromNullishOr(checkerPool), {
|
|
102124
100720
|
onNone: () => succeed$4(plans),
|
|
102125
|
-
onSome: (pool) =>
|
|
100721
|
+
onSome: (pool) => scoped(gen(function* () {
|
|
100722
|
+
const slot = yield* get$2(pool);
|
|
100723
|
+
return yield* reduce$2(slot, () => plans, (passed, { checkerName, checker }) => checkGroupedPlans(checker, checkerName, passed).pipe(catchTags({
|
|
100724
|
+
OutOfMemoryError: (error) => flatMap$1(invalidate(pool, slot), () => fail(error)),
|
|
100725
|
+
ChildProcessCrashedError: (error) => flatMap$1(invalidate(pool, slot), () => fail(error))
|
|
100726
|
+
}), flatMap$1((checked) => forEach$1(checked, (pair) => reportCheckOutcome(pair, reporting), {
|
|
100727
|
+
concurrency: 1,
|
|
100728
|
+
discard: true
|
|
100729
|
+
}).pipe(as(checked.filter(([, result]) => result.status === "passed").map(([plan]) => plan))))));
|
|
100730
|
+
}))
|
|
102126
100731
|
});
|
|
102127
100732
|
const mutationTestCell$1 = Cell_exports.layer({
|
|
102128
100733
|
read: (command) => gen(function* () {
|
|
@@ -102141,7 +100746,7 @@ const mutationTestCell$1 = Cell_exports.layer({
|
|
|
102141
100746
|
mutantCount: raw.prev.mutants.length,
|
|
102142
100747
|
testCount: raw.prev.dryRunResult.tests.length
|
|
102143
100748
|
}, () => gen(function* () {
|
|
102144
|
-
const decision = yield* match$
|
|
100749
|
+
const decision = yield* match$5(outcome, {
|
|
102145
100750
|
onFailure: (err) => fail(StageError.make({
|
|
102146
100751
|
stage: err.stage,
|
|
102147
100752
|
reason: err.reason,
|
|
@@ -102199,17 +100804,21 @@ const mutationTestCell$1 = Cell_exports.layer({
|
|
|
102199
100804
|
testFiles: prev.project.testFiles.map((file) => prev.sandbox.sandboxFileFor(file))
|
|
102200
100805
|
};
|
|
102201
100806
|
const testRunnerPool = yield* make$10({
|
|
102202
|
-
acquire: buildTestRunner(testRunnerContext, suspend$3(() =>
|
|
102203
|
-
|
|
102204
|
-
|
|
102205
|
-
|
|
102206
|
-
|
|
102207
|
-
|
|
102208
|
-
|
|
102209
|
-
|
|
102210
|
-
|
|
102211
|
-
|
|
102212
|
-
|
|
100807
|
+
acquire: buildTestRunner(testRunnerContext, suspend$3(() => {
|
|
100808
|
+
const runnerConfigured = prev.options.testRunner;
|
|
100809
|
+
const runnerLabel = value(runnerConfigured).pipe(when(isCustomTestRunner, (runner) => runner.plugin), orElse((name) => name));
|
|
100810
|
+
return resolveConfiguredWorkerSpawn({
|
|
100811
|
+
loaded: prev.loadedPlugins,
|
|
100812
|
+
kind: "TestRunner",
|
|
100813
|
+
configured: runnerConfigured
|
|
100814
|
+
}).pipe(mapError(missingWorkerEntry("mutationTest", "test runner", runnerLabel)), flatMap$1(({ spawn }) => makeChildProcessTestRunner({
|
|
100815
|
+
options: prev.options,
|
|
100816
|
+
fileDescriptions: prev.project.fileDescriptions,
|
|
100817
|
+
sandboxWorkingDirectory: prev.sandbox.workingDirectory,
|
|
100818
|
+
workerEntrypoint: spawn.entrypoint,
|
|
100819
|
+
idGenerator
|
|
100820
|
+
})));
|
|
100821
|
+
})),
|
|
102213
100822
|
size: prev.concurrency.testRunners
|
|
102214
100823
|
});
|
|
102215
100824
|
const reporting = makeMutationReportingService({
|
|
@@ -102255,7 +100864,7 @@ const mutationTestCell$1 = Cell_exports.layer({
|
|
|
102255
100864
|
const queue2 = yield* RunEvents;
|
|
102256
100865
|
yield* offer(queue2, PlanKnown.make({ total: allPlansForReporter.length + noCoverageResults.length }));
|
|
102257
100866
|
}
|
|
102258
|
-
const passedPlans = yield* checkPlansWithConfiguredCheckers(
|
|
100867
|
+
const passedPlans = yield* checkPlansWithConfiguredCheckers(checkerPool, sortedPlans, reporting);
|
|
102259
100868
|
const testRunnerStream = fromIterable$4(passedPlans);
|
|
102260
100869
|
const plannedTotal = allPlansForReporter.length + noCoverageResults.length + rememberedResults.length;
|
|
102261
100870
|
const pathService = yield* Path;
|
|
@@ -102295,7 +100904,7 @@ const mutationTestCell$1 = Cell_exports.layer({
|
|
|
102295
100904
|
return completed;
|
|
102296
100905
|
});
|
|
102297
100906
|
const reportStreamTested = (result, completed, prepared) => offerReporterEvent(prev.reporterStage, toStreamEvent(result, completed, prepared)).pipe(catchCause((cause) => logWarning("Reporter stream failed handling mutantTested", cause)));
|
|
102298
|
-
const offerStreamTested = (result, completed, prepared) => match$
|
|
100907
|
+
const offerStreamTested = (result, completed, prepared) => match$6(all$2([fromNullishOr(completed), fromNullishOr(prepared)]), {
|
|
102299
100908
|
onNone: () => void_$1,
|
|
102300
100909
|
onSome: ([done, streamable]) => reportStreamTested(result, done, streamable)
|
|
102301
100910
|
});
|
|
@@ -102807,7 +101416,7 @@ const writeRendered = (services, rendered, options) => {
|
|
|
102807
101416
|
};
|
|
102808
101417
|
const makeClearTextReporter = (services) => (options) => (events) => {
|
|
102809
101418
|
const seen = {};
|
|
102810
|
-
return runForEach(fromAsyncIterable(events, streamErrorOf$1), (event) => sync(() => rememberTerminalReport(seen, event))).pipe(andThen$2(sync(() => seen.terminal)), flatMap$1((terminal) => match$
|
|
101419
|
+
return runForEach(fromAsyncIterable(events, streamErrorOf$1), (event) => sync(() => rememberTerminalReport(seen, event))).pipe(andThen$2(sync(() => seen.terminal)), flatMap$1((terminal) => match$6(fromUndefinedOr(terminal), {
|
|
102811
101420
|
onNone: () => void_$1,
|
|
102812
101421
|
onSome: (ready) => decodeClearTextReport(ready).pipe(flatMap$1((command) => writeRendered(services, renderClearText(command.report, command.metrics, options), options)))
|
|
102813
101422
|
})));
|
|
@@ -102842,7 +101451,7 @@ const streamErrorOf = (cause) => ReporterFailed.make({
|
|
|
102842
101451
|
});
|
|
102843
101452
|
const makeJsonReporter = (services) => (options) => (events) => {
|
|
102844
101453
|
const seen = {};
|
|
102845
|
-
return runForEach(fromAsyncIterable(events, streamErrorOf), (event) => sync(() => rememberReport(seen, event))).pipe(andThen$2(sync(() => seen.report)), flatMap$1((report) => match$
|
|
101454
|
+
return runForEach(fromAsyncIterable(events, streamErrorOf), (event) => sync(() => rememberReport(seen, event))).pipe(andThen$2(sync(() => seen.report)), flatMap$1((report) => match$6(fromUndefinedOr(report), {
|
|
102846
101455
|
onNone: () => void_$1,
|
|
102847
101456
|
onSome: (ready) => writeReport(services, options, ready)
|
|
102848
101457
|
})));
|
|
@@ -102953,7 +101562,7 @@ const makeProgressBarReporter = (services) => () => (events) => {
|
|
|
102953
101562
|
const enqueue = (text) => {
|
|
102954
101563
|
pending = pending.then(() => writeAsync(services.stdio, "stdout", [text])).catch(() => void 0);
|
|
102955
101564
|
};
|
|
102956
|
-
const render = (now) => match$
|
|
101565
|
+
const render = (now) => match$6(fromUndefinedOr(progress.bar), {
|
|
102957
101566
|
onNone: () => void 0,
|
|
102958
101567
|
onSome: (bar) => {
|
|
102959
101568
|
const line = renderProgressBar(bar, progressData(progress.tally, now));
|
|
@@ -102992,7 +101601,7 @@ const applyProgressEvent = (progress, render, event) => {
|
|
|
102992
101601
|
total
|
|
102993
101602
|
});
|
|
102994
101603
|
}), tag("mutantTested", (tested) => {
|
|
102995
|
-
match$
|
|
101604
|
+
match$6(fromUndefinedOr(progress.tally.ticksByMutantId[tested.id]), {
|
|
102996
101605
|
onNone: () => void 0,
|
|
102997
101606
|
onSome: (ticks) => {
|
|
102998
101607
|
progress.tally = tallyAfterTest(progress.tally, tested, ticks);
|
|
@@ -103003,7 +101612,7 @@ const applyProgressEvent = (progress, render, event) => {
|
|
|
103003
101612
|
}), orElse(() => void 0));
|
|
103004
101613
|
};
|
|
103005
101614
|
const finishProgressBar = (progress, enqueue) => {
|
|
103006
|
-
match$
|
|
101615
|
+
match$6(fromUndefinedOr(progress.bar), {
|
|
103007
101616
|
onNone: () => void 0,
|
|
103008
101617
|
onSome: (bar) => value(isComplete(bar)).pipe(when(true, () => void 0), when(false, () => enqueue("\n")), exhaustive)
|
|
103009
101618
|
});
|
|
@@ -103079,7 +101688,7 @@ const spawnPluginReporterFactory = (name, loaded, projectBasePath, options) => g
|
|
|
103079
101688
|
})));
|
|
103080
101689
|
return reporterWorkerFactory(client);
|
|
103081
101690
|
});
|
|
103082
|
-
const reporterInputsOf = (names, choicesByName, loaded, projectBasePath, options) => forEach$1(selectReporterChoices(names, choicesByName), (choice) => match$
|
|
101691
|
+
const reporterInputsOf = (names, choicesByName, loaded, projectBasePath, options) => forEach$1(selectReporterChoices(names, choicesByName), (choice) => match$6(choice.builtinFactory, {
|
|
103083
101692
|
onSome: (builtin) => succeed$4({
|
|
103084
101693
|
name: choice.name,
|
|
103085
101694
|
factory: builtin
|
|
@@ -103091,7 +101700,7 @@ const reporterInputsOf = (names, choicesByName, loaded, projectBasePath, options
|
|
|
103091
101700
|
}), { concurrency: 1 });
|
|
103092
101701
|
const selectReporter = (chosen, name, choicesByName) => {
|
|
103093
101702
|
const key = name.toLowerCase();
|
|
103094
|
-
match$
|
|
101703
|
+
match$6(get$3(choicesByName, key), {
|
|
103095
101704
|
onNone: () => void 0,
|
|
103096
101705
|
onSome: (choice) => {
|
|
103097
101706
|
if (!chosen.has(key)) chosen.set(key, choice);
|
|
@@ -103132,7 +101741,7 @@ const readPrepare = (command) => gen(function* () {
|
|
|
103132
101741
|
allowColor: env.allowConsoleColors
|
|
103133
101742
|
}
|
|
103134
101743
|
};
|
|
103135
|
-
const loaded = yield* loadPlugins(
|
|
101744
|
+
const loaded = yield* loadPlugins(pluginUrlsFromOptions(options)).pipe(mapError((cause) => StageError.make({
|
|
103136
101745
|
stage: "prepare",
|
|
103137
101746
|
reason: "Failed to load plugins",
|
|
103138
101747
|
cause
|
|
@@ -103148,8 +101757,7 @@ const readPrepare = (command) => gen(function* () {
|
|
|
103148
101757
|
reason: "Failed to read project",
|
|
103149
101758
|
cause
|
|
103150
101759
|
})));
|
|
103151
|
-
const
|
|
103152
|
-
const ignorers = loaded.ignorers.filter((ignorer) => has(selectedIgnorers, ignorer.name));
|
|
101760
|
+
const ignorers = loaded.ignorers;
|
|
103153
101761
|
const builtinReporterFactories = {
|
|
103154
101762
|
...makeBuiltinReporterFactories({
|
|
103155
101763
|
fileSystem: yield* FileSystem,
|
|
@@ -103299,7 +101907,7 @@ const makeRunEventStream = (stdio, resolved, drainFramed = drainOf.bind(null, st
|
|
|
103299
101907
|
};
|
|
103300
101908
|
}), orElse(() => {}));
|
|
103301
101909
|
})));
|
|
103302
|
-
const tickStream = tick(TICK_INTERVAL_MS).pipe(drop(1), filter
|
|
101910
|
+
const tickStream = tick(TICK_INTERVAL_MS).pipe(drop(1), filter(() => state.headerWritten && !state.terminalWritten), mapEffect$1(() => gen(function* () {
|
|
103303
101911
|
const now = yield* currentTimeMillis;
|
|
103304
101912
|
return Heartbeat.make({
|
|
103305
101913
|
elapsedMs: now - startedAt,
|
|
@@ -103314,7 +101922,7 @@ const makeRunEventStream = (stdio, resolved, drainFramed = drainOf.bind(null, st
|
|
|
103314
101922
|
const progressTap = (event) => {
|
|
103315
101923
|
const line = stderrProgressLine(event, state.terminalWritten);
|
|
103316
101924
|
noteTerminal(event);
|
|
103317
|
-
return match$
|
|
101925
|
+
return match$6(fromUndefinedOr(line), {
|
|
103318
101926
|
onNone: () => void_$1,
|
|
103319
101927
|
onSome: (text) => writeStderr(stdio, text)
|
|
103320
101928
|
});
|
|
@@ -103328,7 +101936,7 @@ const makeRunEventStream = (stdio, resolved, drainFramed = drainOf.bind(null, st
|
|
|
103328
101936
|
markTerminalFramed(event);
|
|
103329
101937
|
return true;
|
|
103330
101938
|
};
|
|
103331
|
-
const drain = drainFramed(merge$1(queueStream, tickStream, { haltStrategy: "either" }).pipe(tap(progressTap)).pipe(filter
|
|
101939
|
+
const drain = drainFramed(merge$1(queueStream, tickStream, { haltStrategy: "either" }).pipe(tap(progressTap)).pipe(filter(frameEvent), map$5((event) => `${toWireLine(event)}\n`)));
|
|
103332
101940
|
let drainFiber = null;
|
|
103333
101941
|
const outputOpen = () => state.mode === "machine" && !state.terminalWritten;
|
|
103334
101942
|
const offerStarted = () => gen(function* () {
|
|
@@ -103412,7 +102020,7 @@ const outputModeProbeCell = Cell_exports.layer({
|
|
|
103412
102020
|
decode: (raw) => succeed$8(commandFor(raw)),
|
|
103413
102021
|
decide: resolveOutputMode,
|
|
103414
102022
|
encode: (outcome) => map$11(outcome, decisionToResolvedMode),
|
|
103415
|
-
write: (outcome) => match$
|
|
102023
|
+
write: (outcome) => match$5(outcome, {
|
|
103416
102024
|
onFailure: (error) => fail(error),
|
|
103417
102025
|
onSuccess: (mode) => succeed$4(mode)
|
|
103418
102026
|
})
|
|
@@ -103462,7 +102070,7 @@ const emitHelpEnvelope = (stream, help) => offer(stream.queue, HelpRendered.make
|
|
|
103462
102070
|
code: 0,
|
|
103463
102071
|
help
|
|
103464
102072
|
}));
|
|
103465
|
-
const helpPayload = (ok, captured) => filter$
|
|
102073
|
+
const helpPayload = (ok, captured) => filter$2(some(captured), () => ok.help || captured.length > 0);
|
|
103466
102074
|
const emitNullScoreVerdictWhenOpen = (stream, mode, basePath, pathService) => gen(function* () {
|
|
103467
102075
|
if (!stream.isOpen()) return;
|
|
103468
102076
|
yield* emitNullScoreVerdict(stream, mode, (yield* defaultOptions$2).thresholds, {}, basePath, pathService);
|
|
@@ -103472,7 +102080,7 @@ function emitMachineModeOutput(stream, mode, outcome, basePath, pathService) {
|
|
|
103472
102080
|
const captured = readCapturedConsole();
|
|
103473
102081
|
if (isSuccess$1(outcome)) {
|
|
103474
102082
|
const decision = outcome.success;
|
|
103475
|
-
return yield* value(decision).pipe(tag("RunOk", (ok) => match$
|
|
102083
|
+
return yield* value(decision).pipe(tag("RunOk", (ok) => match$6(helpPayload(ok, captured), {
|
|
103476
102084
|
onSome: (help) => emitHelpEnvelope(stream, help),
|
|
103477
102085
|
onNone: () => emitNullScoreVerdictWhenOpen(stream, mode, basePath, pathService)
|
|
103478
102086
|
})), tag("RunParseFailed", (failed) => offerFailureEnvelope(stream, failed, captured)), tag("RunSurvivorsRejected", (failed) => offerFailureEnvelope(stream, failed, captured)), tag("RunConfigFailed", (failed) => offerFailureEnvelope(stream, failed, captured)), tag("RunFailed", (failed) => offerFailureEnvelope(stream, failed, captured)), exhaustive);
|
|
@@ -103531,11 +102139,11 @@ const hostOptionsOf = (mode, stream, noColor) => gen(function* () {
|
|
|
103531
102139
|
allowConsoleColors: isColorEnabled(mode, noColor)
|
|
103532
102140
|
};
|
|
103533
102141
|
});
|
|
103534
|
-
const progressStreamFileName = (request) => match$
|
|
102142
|
+
const progressStreamFileName = (request) => match$6(request, {
|
|
103535
102143
|
onNone: () => DEFAULT_PROGRESS_STREAM_FILE,
|
|
103536
102144
|
onSome: (cliRequest) => value(cliRequest).pipe(tag("merge-reports", () => DEFAULT_PROGRESS_STREAM_FILE), tag("run", (runRequest) => getOrElse(decodeUnknownOption(NonEmptyString)(runRequest.options["progressStreamFile"]), () => DEFAULT_PROGRESS_STREAM_FILE)), exhaustive)
|
|
103537
102145
|
});
|
|
103538
|
-
const applyProgressStreamFile = (stream, fileName) => match$
|
|
102146
|
+
const applyProgressStreamFile = (stream, fileName) => match$6(fromUndefinedOr(stream.setProgressStreamFile), {
|
|
103539
102147
|
onNone: () => void_$1,
|
|
103540
102148
|
onSome: (setFileName) => setFileName(fileName)
|
|
103541
102149
|
});
|
|
@@ -103984,7 +102592,7 @@ const survivorsAdmissionCell = Cell_exports.layer({
|
|
|
103984
102592
|
},
|
|
103985
102593
|
decide: admitSurvivorsRun,
|
|
103986
102594
|
encode: (outcome) => outcome,
|
|
103987
|
-
write: (outcome, raw) => match$
|
|
102595
|
+
write: (outcome, raw) => match$5(outcome, {
|
|
103988
102596
|
onSuccess: (admission) => succeed$4({
|
|
103989
102597
|
admission,
|
|
103990
102598
|
resolvedOptions: raw.resolvedOptions,
|
|
@@ -104014,7 +102622,7 @@ function readPriorReport(priorReportPath) {
|
|
|
104014
102622
|
return gen(function* () {
|
|
104015
102623
|
return yield* (yield* FileSystem).readFileString(priorReportPath).pipe(map$7((text) => ({
|
|
104016
102624
|
found: true,
|
|
104017
|
-
raw: match$
|
|
102625
|
+
raw: match$5(decodeResult(fromJsonString(Unknown))(text), {
|
|
104018
102626
|
onFailure: () => text,
|
|
104019
102627
|
onSuccess: (value) => value
|
|
104020
102628
|
})
|
|
@@ -104054,7 +102662,6 @@ const runOptions = {
|
|
|
104054
102662
|
testFiles: string("testFiles").pipe(withAlias("t"), withDescription$1("With `testFiles` you can limit which test files are executed during mutation testing. When specified, only tests from these files will be run. This allows you to verify that a module's dedicated unit tests can kill all its mutants independently."), map$1(splitOnComma), optional),
|
|
104055
102663
|
buildCommand: string("buildCommand").pipe(withAlias("b"), withDescription$1("Configure a build command to run after mutating the code, but before mutants are tested. This is generally used to transpile your code before testing. Only configure this if your test runner doesn't take care of this already and you're not using just-in-time transpiler like `babel/register` or `ts-node`."), optional),
|
|
104056
102664
|
dryRunOnly: map$1(optional(boolean("dryRunOnly")), absentWhenFalse).pipe(withDescription$1("Execute the initial test run only, without doing actual mutation testing. Doing a dry run only can be used to test that StrykerJS can run your test setup, for example, in CI pipelines.")),
|
|
104057
|
-
checkers: string("checkers").pipe(withDescription$1("A comma separated list of checkers to use, for example --checkers typescript"), map$1(splitOnComma), optional),
|
|
104058
102665
|
checkerNodeArgs: string("checkerNodeArgs").pipe(withDescription$1("A list of node args to be passed to checker child processes. Split on spaces (commander characterization): `--checkerNodeArgs \"--inspect-brk --trace-warnings\"`."), map$1(splitOnSpace), optional),
|
|
104059
102666
|
coverageAnalysis: choice("coverageAnalysis", [
|
|
104060
102667
|
"perTest",
|
|
@@ -104129,7 +102736,6 @@ function makeStrykerCommand(requestRef) {
|
|
|
104129
102736
|
setIfPresent(options, "testFiles", config.testFiles);
|
|
104130
102737
|
setIfPresent(options, "buildCommand", config.buildCommand);
|
|
104131
102738
|
setIfPresent(options, "dryRunOnly", config.dryRunOnly);
|
|
104132
|
-
setIfPresent(options, "checkers", config.checkers);
|
|
104133
102739
|
setIfPresent(options, "checkerNodeArgs", config.checkerNodeArgs);
|
|
104134
102740
|
setIfPresent(options, "coverageAnalysis", config.coverageAnalysis);
|
|
104135
102741
|
setIfPresent(options, "testRunner", config.testRunner);
|
|
@@ -104230,16 +102836,16 @@ const runStrykerCli = (input, createRunEventStream) => gen(function* () {
|
|
|
104230
102836
|
yield* applyProgressStreamFile(stream, progressStreamFileName(request));
|
|
104231
102837
|
yield* stream.open;
|
|
104232
102838
|
if (isFailure$1(parsed)) return yield* parsed.failure;
|
|
104233
|
-
return yield* match$
|
|
102839
|
+
return yield* match$6(request, {
|
|
104234
102840
|
onNone: () => void_$1,
|
|
104235
102841
|
onSome: (cliRequest) => dispatch(cliRequest)
|
|
104236
102842
|
});
|
|
104237
102843
|
});
|
|
104238
|
-
const outcomeOf = (result) => match$
|
|
102844
|
+
const outcomeOf = (result) => match$5(result, {
|
|
104239
102845
|
onSuccess: (decision) => decision._tag,
|
|
104240
102846
|
onFailure: (error) => error._tag
|
|
104241
102847
|
});
|
|
104242
|
-
const errorTextOf = (result) => match$
|
|
102848
|
+
const errorTextOf = (result) => match$5(result, {
|
|
104243
102849
|
onSuccess: () => "",
|
|
104244
102850
|
onFailure: (failure) => {
|
|
104245
102851
|
const text = errorText$1(failure, readCapturedConsole());
|
|
@@ -104256,7 +102862,7 @@ const runStrykerCli = (input, createRunEventStream) => gen(function* () {
|
|
|
104256
102862
|
});
|
|
104257
102863
|
if (input.mode.mode === "machine") yield* emitMachineModeOutput(stream, input.mode, outcome, basePath, pathService);
|
|
104258
102864
|
yield* stream.closeAndDrain;
|
|
104259
|
-
yield* match$
|
|
102865
|
+
yield* match$5(outcome, {
|
|
104260
102866
|
onSuccess: (decision) => value(decision).pipe(tag("RunOk", () => void_$1), orElse(() => fail(RunExit.make({ code })))),
|
|
104261
102867
|
onFailure: (interrupted) => fail(RunExit.make({ code: interrupted.code }))
|
|
104262
102868
|
});
|
|
@@ -104278,7 +102884,7 @@ const PROCESSOR_BY_KIND = {
|
|
|
104278
102884
|
simple: (exporter) => new import_index_shim.SimpleSpanProcessor(exporter)
|
|
104279
102885
|
};
|
|
104280
102886
|
const TRACES_PATH = "/v1/traces";
|
|
104281
|
-
const tracesUrlFor = (endpoint) => match$
|
|
102887
|
+
const tracesUrlFor = (endpoint) => match$6(fromUndefinedOr(endpoint), {
|
|
104282
102888
|
onNone: () => void 0,
|
|
104283
102889
|
onSome: (base) => {
|
|
104284
102890
|
const trimmed = base.replace(/\/+$/u, "");
|