@systemfsoftware/stryker-js-vitest-runner 8.0.2 → 8.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 +18 -0
- package/dist/main.mjs +1734 -1798
- package/dist/stryker-setup.mjs +168 -228
- package/package.json +21 -20
package/dist/stryker-setup.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterAll, afterEach, beforeAll, beforeEach, inject } from "vitest";
|
|
2
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
2
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Pipeable.js
|
|
3
3
|
/**
|
|
4
4
|
* The `Pipeable` module defines the shared interface and implementation helpers
|
|
5
5
|
* for values that support Effect-style method chaining with `.pipe(...)`.
|
|
@@ -70,7 +70,7 @@ const pipeArguments = (self, args) => {
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
//#endregion
|
|
73
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
73
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Function.js
|
|
74
74
|
/**
|
|
75
75
|
* Creates a function that can be called in data-first style or data-last
|
|
76
76
|
* (`pipe`-friendly) style.
|
|
@@ -182,7 +182,7 @@ const dual = function(arity, body) {
|
|
|
182
182
|
*/
|
|
183
183
|
const identity = (a) => a;
|
|
184
184
|
//#endregion
|
|
185
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
185
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/internal/equal.js
|
|
186
186
|
/** @internal */
|
|
187
187
|
const getAllObjectKeys = (obj) => {
|
|
188
188
|
const keys = new Set(Reflect.ownKeys(obj));
|
|
@@ -200,8 +200,22 @@ const getAllObjectKeys = (obj) => {
|
|
|
200
200
|
};
|
|
201
201
|
/** @internal */
|
|
202
202
|
const byReferenceInstances = /*#__PURE__*/ new WeakSet();
|
|
203
|
+
/** @internal */
|
|
204
|
+
const viewBytes = (view) => new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
|
|
203
205
|
//#endregion
|
|
204
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
206
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/internal/hash.js
|
|
207
|
+
/**
|
|
208
|
+
* Back-edge count used to avoid caching entry-point-dependent hashes.
|
|
209
|
+
*
|
|
210
|
+
* @internal
|
|
211
|
+
*/
|
|
212
|
+
let backEdges = 0;
|
|
213
|
+
/** @internal */
|
|
214
|
+
const addBackEdge = () => {
|
|
215
|
+
backEdges++;
|
|
216
|
+
};
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Predicate.js
|
|
205
219
|
/**
|
|
206
220
|
* Defines runtime checks for values.
|
|
207
221
|
*
|
|
@@ -306,7 +320,7 @@ function isObjectKeyword(input) {
|
|
|
306
320
|
*/
|
|
307
321
|
const hasProperty = /*#__PURE__*/ dual(2, (self, property) => isObjectKeyword(self) && property in self);
|
|
308
322
|
//#endregion
|
|
309
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
323
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Hash.js
|
|
310
324
|
/**
|
|
311
325
|
* Computes Effect hash values and defines the interface for objects that want
|
|
312
326
|
* to provide their own hash implementation. Hashes are small numeric
|
|
@@ -374,30 +388,39 @@ const hash = (self) => {
|
|
|
374
388
|
case "number": return number(self);
|
|
375
389
|
case "bigint": return string(self.toString(10));
|
|
376
390
|
case "string": return string(self);
|
|
377
|
-
case "undefined": return string("undefined");
|
|
378
391
|
case "function":
|
|
379
|
-
case "object": if (self === null)
|
|
392
|
+
case "object": if (self === null) break;
|
|
380
393
|
else if (self instanceof Date) {
|
|
381
394
|
if (Number.isNaN(self.getTime())) return string("Invalid Date");
|
|
382
395
|
return string(self.toISOString());
|
|
383
396
|
} else if (self instanceof RegExp) return string(self.toString());
|
|
384
397
|
else {
|
|
385
398
|
if (byReferenceInstances.has(self)) return random(self);
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
399
|
+
const cached = hashCache.get(self);
|
|
400
|
+
if (cached !== void 0) return cached;
|
|
401
|
+
if (visitedObjects.has(self)) {
|
|
402
|
+
addBackEdge();
|
|
403
|
+
return string("[Circular]");
|
|
404
|
+
}
|
|
405
|
+
visitedObjects.add(self);
|
|
406
|
+
const seen = backEdges;
|
|
407
|
+
let h;
|
|
408
|
+
try {
|
|
409
|
+
if ("~effect/Hash" in self) h = self[symbol$1]();
|
|
410
|
+
else if (typeof self === "function") h = random(self);
|
|
411
|
+
else if (self instanceof DataView) h = array(viewBytes(self));
|
|
412
|
+
else if (Array.isArray(self) || ArrayBuffer.isView(self)) h = array(self);
|
|
413
|
+
else if (self instanceof Map) h = hashMap(self);
|
|
414
|
+
else if (self instanceof Set) h = hashSet(self);
|
|
415
|
+
else h = structure(self);
|
|
416
|
+
} finally {
|
|
417
|
+
visitedObjects.delete(self);
|
|
418
|
+
}
|
|
419
|
+
if (seen === backEdges) hashCache.set(self, h);
|
|
397
420
|
return h;
|
|
398
421
|
}
|
|
399
|
-
default: return string(String(self));
|
|
400
422
|
}
|
|
423
|
+
return optimize(mix(string(String(self))));
|
|
401
424
|
};
|
|
402
425
|
/**
|
|
403
426
|
* Generates a random hash value for an object and caches it.
|
|
@@ -429,9 +452,16 @@ const hash = (self) => {
|
|
|
429
452
|
* @since 2.0.0
|
|
430
453
|
*/
|
|
431
454
|
const random = (self) => {
|
|
432
|
-
if (!randomHashCache.has(self)) randomHashCache.set(self,
|
|
455
|
+
if (!randomHashCache.has(self)) randomHashCache.set(self, optimize(Math.random() * 4294967296 | 0));
|
|
433
456
|
return randomHashCache.get(self);
|
|
434
457
|
};
|
|
458
|
+
const mix = (h) => {
|
|
459
|
+
h ^= h >>> 16;
|
|
460
|
+
h = Math.imul(h, 2246822507);
|
|
461
|
+
h ^= h >>> 13;
|
|
462
|
+
h = Math.imul(h, 3266489909);
|
|
463
|
+
return h ^ h >>> 16;
|
|
464
|
+
};
|
|
435
465
|
/**
|
|
436
466
|
* Combines two hash values into a single hash value.
|
|
437
467
|
*
|
|
@@ -442,8 +472,7 @@ const random = (self) => {
|
|
|
442
472
|
*
|
|
443
473
|
* **Details**
|
|
444
474
|
*
|
|
445
|
-
* Supports
|
|
446
|
-
* hash values with `(self * 53) ^ b`.
|
|
475
|
+
* Supports direct and pipeable usage. Argument order affects the result.
|
|
447
476
|
*
|
|
448
477
|
* **Example** (Combining hash values)
|
|
449
478
|
*
|
|
@@ -463,7 +492,7 @@ const random = (self) => {
|
|
|
463
492
|
* @category hashing
|
|
464
493
|
* @since 2.0.0
|
|
465
494
|
*/
|
|
466
|
-
const combine = /*#__PURE__*/ dual(2, (self, b) => self
|
|
495
|
+
const combine = /*#__PURE__*/ dual(2, (self, b) => mix(Math.imul(self, 2654435761) + Math.imul(b, 2246822507)));
|
|
467
496
|
/**
|
|
468
497
|
* Applies bit manipulation techniques to optimize a hash value.
|
|
469
498
|
*
|
|
@@ -488,38 +517,7 @@ const combine = /*#__PURE__*/ dual(2, (self, b) => self * 53 ^ b);
|
|
|
488
517
|
* @since 2.0.0
|
|
489
518
|
*/
|
|
490
519
|
const optimize = (n) => n & 3221225471 | n >>> 1 & 1073741824;
|
|
491
|
-
|
|
492
|
-
* Checks whether a value implements the Hash interface.
|
|
493
|
-
*
|
|
494
|
-
* **When to use**
|
|
495
|
-
*
|
|
496
|
-
* Use to detect whether an unknown value provides a custom hash implementation.
|
|
497
|
-
*
|
|
498
|
-
* **Details**
|
|
499
|
-
*
|
|
500
|
-
* This function determines whether a given value has the Hash symbol property,
|
|
501
|
-
* indicating that it can provide its own hash value implementation.
|
|
502
|
-
*
|
|
503
|
-
* **Example** (Checking for Hash support)
|
|
504
|
-
*
|
|
505
|
-
* ```ts import.meta.vitest
|
|
506
|
-
* import { Hash } from "effect"
|
|
507
|
-
*
|
|
508
|
-
* class MyHashable implements Hash.Hash {
|
|
509
|
-
* [Hash.symbol]() {
|
|
510
|
-
* return 42
|
|
511
|
-
* }
|
|
512
|
-
* }
|
|
513
|
-
*
|
|
514
|
-
* Hash.isHash(new MyHashable()) // => true
|
|
515
|
-
* Hash.isHash({}) // => false
|
|
516
|
-
* Hash.isHash("string") // => false
|
|
517
|
-
* ```
|
|
518
|
-
*
|
|
519
|
-
* @category guards
|
|
520
|
-
* @since 2.0.0
|
|
521
|
-
*/
|
|
522
|
-
const isHash = (u) => hasProperty(u, symbol$1);
|
|
520
|
+
const float64 = /*#__PURE__*/ new DataView(/*#__PURE__*/ new ArrayBuffer(8));
|
|
523
521
|
/**
|
|
524
522
|
* Computes a hash value for a number.
|
|
525
523
|
*
|
|
@@ -529,9 +527,8 @@ const isHash = (u) => hasProperty(u, symbol$1);
|
|
|
529
527
|
*
|
|
530
528
|
* **Details**
|
|
531
529
|
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
* of hash values across different numeric inputs.
|
|
530
|
+
* Int32 values hash to themselves. Other numbers hash from their IEEE-754 bits,
|
|
531
|
+
* with a canonical representation for `NaN`.
|
|
535
532
|
*
|
|
536
533
|
* **Example** (Hashing numbers)
|
|
537
534
|
*
|
|
@@ -549,11 +546,10 @@ const isHash = (u) => hasProperty(u, symbol$1);
|
|
|
549
546
|
* @since 2.0.0
|
|
550
547
|
*/
|
|
551
548
|
const number = (n) => {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
return optimize(h);
|
|
549
|
+
const h = n | 0;
|
|
550
|
+
if (h === n) return optimize(h);
|
|
551
|
+
float64.setFloat64(0, n !== n ? NaN : n);
|
|
552
|
+
return optimize(combine(float64.getInt32(0), float64.getInt32(4)));
|
|
557
553
|
};
|
|
558
554
|
/**
|
|
559
555
|
* Computes a hash value for a string using the djb2 algorithm.
|
|
@@ -611,8 +607,8 @@ const string = (str) => {
|
|
|
611
607
|
* const hash1 = Hash.structureKeys(person, ["name", "age"])
|
|
612
608
|
* const hash2 = Hash.structureKeys(person, ["name", "city"])
|
|
613
609
|
*
|
|
614
|
-
* hash1 // => -
|
|
615
|
-
* hash2 // =>
|
|
610
|
+
* hash1 // => -731887653
|
|
611
|
+
* hash2 // => 148523102
|
|
616
612
|
*
|
|
617
613
|
* const person2 = { name: "John", age: 30, city: "Boston" }
|
|
618
614
|
* const hash3 = Hash.structureKeys(person2, ["name", "age"])
|
|
@@ -648,9 +644,9 @@ const structureKeys = (o, keys) => {
|
|
|
648
644
|
* const obj2 = { name: "Jane", age: 25 }
|
|
649
645
|
* const obj3 = { name: "John", age: 30 }
|
|
650
646
|
*
|
|
651
|
-
* Hash.structure(obj1) // => -
|
|
652
|
-
* Hash.structure(obj2) // => -
|
|
653
|
-
* Hash.structure(obj3) // => -
|
|
647
|
+
* Hash.structure(obj1) // => -731887653
|
|
648
|
+
* Hash.structure(obj2) // => -222100417
|
|
649
|
+
* Hash.structure(obj3) // => -731887653
|
|
654
650
|
* Hash.structure(obj1) === Hash.structure(obj3) // => true
|
|
655
651
|
* ```
|
|
656
652
|
*
|
|
@@ -658,7 +654,7 @@ const structureKeys = (o, keys) => {
|
|
|
658
654
|
* @since 2.0.0
|
|
659
655
|
*/
|
|
660
656
|
const structure = (o) => structureKeys(o, getAllObjectKeys(o));
|
|
661
|
-
const
|
|
657
|
+
const unordered = (seed, f) => (iter) => {
|
|
662
658
|
let h = seed;
|
|
663
659
|
for (const element of iter) h ^= f(element);
|
|
664
660
|
return optimize(h);
|
|
@@ -672,13 +668,12 @@ const iterableWith = (seed, f) => (iter) => {
|
|
|
672
668
|
*
|
|
673
669
|
* **Details**
|
|
674
670
|
*
|
|
675
|
-
*
|
|
676
|
-
*
|
|
671
|
+
* Folds element hashes with {@link combine}, so order and length affect the
|
|
672
|
+
* result.
|
|
677
673
|
*
|
|
678
674
|
* **Gotchas**
|
|
679
675
|
*
|
|
680
|
-
* A hash is not an equality proof.
|
|
681
|
-
* reordered inputs can produce the same hash.
|
|
676
|
+
* A hash is not an equality proof. Distinct inputs can still share a hash.
|
|
682
677
|
*
|
|
683
678
|
* **Example** (Hashing arrays)
|
|
684
679
|
*
|
|
@@ -689,11 +684,8 @@ const iterableWith = (seed, f) => (iter) => {
|
|
|
689
684
|
* const arr2 = [1, 2, 3]
|
|
690
685
|
* const arr3 = [3, 2, 1]
|
|
691
686
|
*
|
|
692
|
-
* Hash.array(arr1) // => 6151
|
|
693
|
-
* Hash.array(arr2) // => 6151
|
|
694
|
-
* Hash.array(arr3) // => 6151
|
|
695
687
|
* Hash.array(arr1) === Hash.array(arr2) // => true
|
|
696
|
-
* Hash.array(arr1) === Hash.array(arr3) // =>
|
|
688
|
+
* Hash.array(arr1) === Hash.array(arr3) // => false
|
|
697
689
|
* ```
|
|
698
690
|
*
|
|
699
691
|
* @see {@link hash} for the general-purpose hash dispatcher
|
|
@@ -701,21 +693,19 @@ const iterableWith = (seed, f) => (iter) => {
|
|
|
701
693
|
* @category hashing
|
|
702
694
|
* @since 2.0.0
|
|
703
695
|
*/
|
|
704
|
-
const array =
|
|
705
|
-
|
|
706
|
-
const
|
|
696
|
+
const array = (arr) => {
|
|
697
|
+
let h = 6151;
|
|
698
|
+
for (const element of arr) h = combine(h, hash(element));
|
|
699
|
+
return optimize(h);
|
|
700
|
+
};
|
|
701
|
+
const hashMap = /*#__PURE__*/ unordered(/*#__PURE__*/ string("Map"), ([k, v]) => combine(hash(k), hash(v)));
|
|
702
|
+
const setSeed = /*#__PURE__*/ string("Set");
|
|
703
|
+
const hashSet = /*#__PURE__*/ unordered(setSeed, (element) => combine(setSeed, hash(element)));
|
|
707
704
|
const randomHashCache = /*#__PURE__*/ new WeakMap();
|
|
708
705
|
const hashCache = /*#__PURE__*/ new WeakMap();
|
|
709
706
|
const visitedObjects = /*#__PURE__*/ new WeakSet();
|
|
710
|
-
function withVisitedTracking$1(obj, fn) {
|
|
711
|
-
if (visitedObjects.has(obj)) return string("[Circular]");
|
|
712
|
-
visitedObjects.add(obj);
|
|
713
|
-
const result = fn();
|
|
714
|
-
visitedObjects.delete(obj);
|
|
715
|
-
return result;
|
|
716
|
-
}
|
|
717
707
|
//#endregion
|
|
718
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
708
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Equal.js
|
|
719
709
|
/**
|
|
720
710
|
* Defines the unique string identifier for the `Equal` interface.
|
|
721
711
|
*
|
|
@@ -767,80 +757,59 @@ function compareBoth(self, that) {
|
|
|
767
757
|
if (selfType === "number" && self !== self && that !== that) return true;
|
|
768
758
|
if (selfType !== "object" && selfType !== "function") return false;
|
|
769
759
|
if (byReferenceInstances.has(self) || byReferenceInstances.has(that)) return false;
|
|
770
|
-
return
|
|
760
|
+
return compareObjects(self, that);
|
|
771
761
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
if (
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
const result = fn();
|
|
781
|
-
visitedLeft.delete(self);
|
|
782
|
-
visitedRight.delete(that);
|
|
762
|
+
function compareObjects(self, that) {
|
|
763
|
+
const depth = pathLeft.length;
|
|
764
|
+
for (let i = depth; i-- > 0;) if (pathLeft[i] === self && pathRight[i] === that) return true;
|
|
765
|
+
if (depth) return compareOnPath(self, that);
|
|
766
|
+
let known = results.get(self);
|
|
767
|
+
if (!known) results.set(self, known = /* @__PURE__ */ new WeakMap());
|
|
768
|
+
let result = known.get(that);
|
|
769
|
+
if (result === void 0) known.set(that, result = compareOnPath(self, that));
|
|
783
770
|
return result;
|
|
784
771
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
772
|
+
function compareOnPath(self, that) {
|
|
773
|
+
pathLeft.push(self);
|
|
774
|
+
pathRight.push(that);
|
|
775
|
+
try {
|
|
776
|
+
return compareStructure(self, that);
|
|
777
|
+
} finally {
|
|
778
|
+
pathLeft.pop();
|
|
779
|
+
pathRight.pop();
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
const pathLeft = [];
|
|
783
|
+
const pathRight = [];
|
|
784
|
+
const results = /*#__PURE__*/ new WeakMap();
|
|
785
|
+
function compareStructure(self, that) {
|
|
789
786
|
if (hash(self) !== hash(that)) return false;
|
|
790
787
|
else if (self instanceof Date) {
|
|
791
788
|
if (!(that instanceof Date)) return false;
|
|
792
789
|
const selfTime = self.getTime();
|
|
793
790
|
const thatTime = that.getTime();
|
|
794
791
|
return selfTime === thatTime || Number.isNaN(selfTime) && Number.isNaN(thatTime);
|
|
795
|
-
} else if (self instanceof RegExp)
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
if (
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
const thatDataView = that;
|
|
814
|
-
return compareTypedArrays(new Uint8Array(self.buffer, self.byteOffset, self.byteLength), new Uint8Array(thatDataView.buffer, thatDataView.byteOffset, thatDataView.byteLength));
|
|
815
|
-
}
|
|
816
|
-
return compareTypedArrays(self, that);
|
|
817
|
-
} else if (self instanceof Map) {
|
|
818
|
-
if (!(that instanceof Map) || self.size !== that.size) return false;
|
|
819
|
-
return compareMaps(self, that);
|
|
820
|
-
} else if (self instanceof Set) {
|
|
821
|
-
if (!(that instanceof Set) || self.size !== that.size) return false;
|
|
822
|
-
return compareSets(self, that);
|
|
823
|
-
}
|
|
824
|
-
return compareRecords(self, that);
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
|
-
function withCache(self, that, f) {
|
|
828
|
-
let selfMap = equalityCache.get(self);
|
|
829
|
-
if (!selfMap) {
|
|
830
|
-
selfMap = /* @__PURE__ */ new WeakMap();
|
|
831
|
-
equalityCache.set(self, selfMap);
|
|
832
|
-
} else if (selfMap.has(that)) return selfMap.get(that);
|
|
833
|
-
const result = f(self, that);
|
|
834
|
-
selfMap.set(that, result);
|
|
835
|
-
let thatMap = equalityCache.get(that);
|
|
836
|
-
if (!thatMap) {
|
|
837
|
-
thatMap = /* @__PURE__ */ new WeakMap();
|
|
838
|
-
equalityCache.set(that, thatMap);
|
|
792
|
+
} else if (self instanceof RegExp) return that instanceof RegExp && self.toString() === that.toString();
|
|
793
|
+
const bothEquals = isEqual(self);
|
|
794
|
+
if (bothEquals !== isEqual(that) || typeof self === "function" && !bothEquals) return false;
|
|
795
|
+
else if (bothEquals) return self[symbol](that);
|
|
796
|
+
else if (Array.isArray(self)) {
|
|
797
|
+
if (!Array.isArray(that) || self.length !== that.length) return false;
|
|
798
|
+
return compareArrays(self, that);
|
|
799
|
+
} else if (ArrayBuffer.isView(self)) {
|
|
800
|
+
const selfIsDataView = self instanceof DataView;
|
|
801
|
+
if (!ArrayBuffer.isView(that) || self.byteLength !== that.byteLength || selfIsDataView !== that instanceof DataView) return false;
|
|
802
|
+
if (selfIsDataView) return compareTypedArrays(viewBytes(self), viewBytes(that));
|
|
803
|
+
return compareTypedArrays(self, that);
|
|
804
|
+
} else if (self instanceof Map) {
|
|
805
|
+
if (!(that instanceof Map) || self.size !== that.size) return false;
|
|
806
|
+
return compareHashed(self, that, entryHash, equalEntries);
|
|
807
|
+
} else if (self instanceof Set) {
|
|
808
|
+
if (!(that instanceof Set) || self.size !== that.size) return false;
|
|
809
|
+
return compareHashed(self, that, hash, compareBoth);
|
|
839
810
|
}
|
|
840
|
-
|
|
841
|
-
return result;
|
|
811
|
+
return compareRecords(self, that);
|
|
842
812
|
}
|
|
843
|
-
const equalityCache = /*#__PURE__*/ new WeakMap();
|
|
844
813
|
function compareArrays(self, that) {
|
|
845
814
|
for (let i = 0; i < self.length; i++) if (!compareBoth(self[i], that[i])) return false;
|
|
846
815
|
return true;
|
|
@@ -857,48 +826,29 @@ function compareRecords(self, that) {
|
|
|
857
826
|
for (const key of selfKeys) if (!thatKeys.has(key) || !compareBoth(self[key], that[key])) return false;
|
|
858
827
|
return true;
|
|
859
828
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
const
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
if (!found) return false;
|
|
876
|
-
}
|
|
877
|
-
return true;
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
const compareMaps = /*#__PURE__*/ makeCompareMap(compareBoth, compareBoth);
|
|
881
|
-
/** @internal */
|
|
882
|
-
function makeCompareSet(equivalence) {
|
|
883
|
-
return function compareSets(self, that) {
|
|
884
|
-
const thatValues = Array.from(that);
|
|
885
|
-
for (const selfValue of self) {
|
|
886
|
-
let found = false;
|
|
887
|
-
for (let i = 0; i < thatValues.length; i++) {
|
|
888
|
-
const thatValue = thatValues[i];
|
|
889
|
-
if (equivalence(selfValue, thatValue)) {
|
|
890
|
-
thatValues[i] = thatValues[thatValues.length - 1];
|
|
891
|
-
thatValues.pop();
|
|
892
|
-
found = true;
|
|
893
|
-
break;
|
|
894
|
-
}
|
|
829
|
+
function compareHashed(self, that, hashOf, equivalent) {
|
|
830
|
+
const groups = /* @__PURE__ */ new Map();
|
|
831
|
+
for (const item of that) {
|
|
832
|
+
const h = hashOf(item);
|
|
833
|
+
const group = groups.get(h);
|
|
834
|
+
if (group) group.push(item);
|
|
835
|
+
else groups.set(h, [item]);
|
|
836
|
+
}
|
|
837
|
+
outer: for (const item of self) {
|
|
838
|
+
const group = groups.get(hashOf(item));
|
|
839
|
+
if (group) {
|
|
840
|
+
for (let i = 0; i < group.length; i++) if (equivalent(item, group[i])) {
|
|
841
|
+
group[i] = group[group.length - 1];
|
|
842
|
+
group.pop();
|
|
843
|
+
continue outer;
|
|
895
844
|
}
|
|
896
|
-
if (!found) return false;
|
|
897
845
|
}
|
|
898
|
-
return
|
|
899
|
-
}
|
|
846
|
+
return false;
|
|
847
|
+
}
|
|
848
|
+
return true;
|
|
900
849
|
}
|
|
901
|
-
const
|
|
850
|
+
const entryHash = (entry) => hash(entry[0]);
|
|
851
|
+
const equalEntries = (self, that) => compareBoth(self[0], that[0]) && compareBoth(self[1], that[1]);
|
|
902
852
|
/**
|
|
903
853
|
* Checks whether a value implements the {@link Equal} interface.
|
|
904
854
|
*
|
|
@@ -941,7 +891,7 @@ const compareSets = /*#__PURE__*/ makeCompareSet(compareBoth);
|
|
|
941
891
|
*/
|
|
942
892
|
const isEqual = (u) => hasProperty(u, symbol);
|
|
943
893
|
//#endregion
|
|
944
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
894
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Redactable.js
|
|
945
895
|
/**
|
|
946
896
|
* Defines the symbol used to identify objects that implement the {@link Redactable}
|
|
947
897
|
* protocol.
|
|
@@ -1058,7 +1008,7 @@ const emptyContext = {
|
|
|
1058
1008
|
}
|
|
1059
1009
|
};
|
|
1060
1010
|
//#endregion
|
|
1061
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
1011
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Formatter.js
|
|
1062
1012
|
/**
|
|
1063
1013
|
* Formats JavaScript values into readable strings.
|
|
1064
1014
|
*
|
|
@@ -1225,7 +1175,7 @@ function safeGet(input, key) {
|
|
|
1225
1175
|
}
|
|
1226
1176
|
}
|
|
1227
1177
|
//#endregion
|
|
1228
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
1178
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Inspectable.js
|
|
1229
1179
|
/**
|
|
1230
1180
|
* Defines the symbol used by Node.js for custom object inspection.
|
|
1231
1181
|
*
|
|
@@ -1292,9 +1242,10 @@ const toJson = (input) => {
|
|
|
1292
1242
|
}
|
|
1293
1243
|
};
|
|
1294
1244
|
//#endregion
|
|
1295
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
1245
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Utils.js
|
|
1296
1246
|
/**
|
|
1297
|
-
* Yields its wrapped value exactly once
|
|
1247
|
+
* Yields its wrapped value exactly once, then completes with the value sent
|
|
1248
|
+
* back in.
|
|
1298
1249
|
*
|
|
1299
1250
|
* **When to use**
|
|
1300
1251
|
*
|
|
@@ -1304,10 +1255,11 @@ const toJson = (input) => {
|
|
|
1304
1255
|
*
|
|
1305
1256
|
* **Details**
|
|
1306
1257
|
*
|
|
1307
|
-
* The first call to `next()` returns `{ value: self, done: false }`.
|
|
1308
|
-
* subsequent call returns `{ value: a, done: true }` where `a` is the
|
|
1309
|
-
* passed to `next()`. `
|
|
1310
|
-
*
|
|
1258
|
+
* The first call to `next()` returns a fresh `{ value: self, done: false }`.
|
|
1259
|
+
* Every subsequent call returns `{ value: a, done: true }` where `a` is the
|
|
1260
|
+
* argument passed to `next()`. To keep `yield*` cheap, the completion result
|
|
1261
|
+
* is the iterator itself rather than a new object, so only the iterator and
|
|
1262
|
+
* the single yielded result are allocated per `yield*`.
|
|
1311
1263
|
*
|
|
1312
1264
|
* **Example** (Yielding a wrapped value in a generator)
|
|
1313
1265
|
*
|
|
@@ -1316,20 +1268,19 @@ const toJson = (input) => {
|
|
|
1316
1268
|
*
|
|
1317
1269
|
* const gen = new Utils.SingleShotGen<string, number>("hello")
|
|
1318
1270
|
*
|
|
1319
|
-
* gen.next(0) // =>
|
|
1271
|
+
* gen.next(0).value // => "hello"
|
|
1320
1272
|
*
|
|
1321
|
-
* gen.next(42) // =>
|
|
1273
|
+
* gen.next(42).value // => 42
|
|
1322
1274
|
* ```
|
|
1323
1275
|
*
|
|
1324
1276
|
* @see {@link Gen} for the type-level signature that relies on `SingleShotGen`
|
|
1325
1277
|
* @category constructors
|
|
1326
1278
|
* @since 2.0.0
|
|
1327
1279
|
*/
|
|
1328
|
-
var SingleShotGen = class
|
|
1329
|
-
called = false;
|
|
1330
|
-
self;
|
|
1280
|
+
var SingleShotGen = class {
|
|
1331
1281
|
constructor(self) {
|
|
1332
|
-
this.
|
|
1282
|
+
this.value = self;
|
|
1283
|
+
this.done = false;
|
|
1333
1284
|
}
|
|
1334
1285
|
/**
|
|
1335
1286
|
* Yields the stored value once, then completes with the value sent back in.
|
|
@@ -1342,30 +1293,19 @@ var SingleShotGen = class SingleShotGen {
|
|
|
1342
1293
|
* @since 2.0.0
|
|
1343
1294
|
*/
|
|
1344
1295
|
next(a) {
|
|
1345
|
-
|
|
1346
|
-
value
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1296
|
+
if (this.done) {
|
|
1297
|
+
this.value = a;
|
|
1298
|
+
return this;
|
|
1299
|
+
}
|
|
1300
|
+
this.done = true;
|
|
1301
|
+
return {
|
|
1302
|
+
value: this.value,
|
|
1350
1303
|
done: false
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
/**
|
|
1354
|
-
* Creates a fresh single-shot iterator over the stored value.
|
|
1355
|
-
*
|
|
1356
|
-
* **When to use**
|
|
1357
|
-
*
|
|
1358
|
-
* Use to iterate the wrapped value again without reusing the consumed
|
|
1359
|
-
* iterator state.
|
|
1360
|
-
*
|
|
1361
|
-
* @since 2.0.0
|
|
1362
|
-
*/
|
|
1363
|
-
[Symbol.iterator]() {
|
|
1364
|
-
return new SingleShotGen(this.self);
|
|
1304
|
+
};
|
|
1365
1305
|
}
|
|
1366
1306
|
};
|
|
1367
1307
|
//#endregion
|
|
1368
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
1308
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/internal/core.js
|
|
1369
1309
|
/** @internal */
|
|
1370
1310
|
const EffectTypeId = `~effect/Effect`;
|
|
1371
1311
|
`${EffectTypeId}`;
|
|
@@ -1394,7 +1334,7 @@ const PipeInspectableProto = {
|
|
|
1394
1334
|
};
|
|
1395
1335
|
({ ...PipeInspectableProto });
|
|
1396
1336
|
//#endregion
|
|
1397
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
1337
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/internal/result.js
|
|
1398
1338
|
const TypeId$1 = "~effect/Result";
|
|
1399
1339
|
const CommonProto = {
|
|
1400
1340
|
[TypeId$1]: {
|
|
@@ -1468,7 +1408,7 @@ SuccessImpl.prototype = SuccessProto;
|
|
|
1468
1408
|
/** @internal */
|
|
1469
1409
|
const succeed$1 = (success) => new SuccessImpl(success);
|
|
1470
1410
|
//#endregion
|
|
1471
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
1411
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Result.js
|
|
1472
1412
|
/**
|
|
1473
1413
|
* Creates a `Result` holding a `Success` value.
|
|
1474
1414
|
*
|
|
@@ -1668,7 +1608,7 @@ const result = (self) => {
|
|
|
1668
1608
|
};
|
|
1669
1609
|
};
|
|
1670
1610
|
//#endregion
|
|
1671
|
-
//#region ../../node_modules/.pnpm/effect@4.0.0
|
|
1611
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0/node_modules/effect/dist/Match.js
|
|
1672
1612
|
/**
|
|
1673
1613
|
* Builds pattern matchers for TypeScript values.
|
|
1674
1614
|
*
|