@fedify/vocab 2.1.1 → 2.1.2
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/deno.json +1 -1
- package/dist/mod.cjs +3873 -5608
- package/dist/mod.d.cts +383 -384
- package/dist/mod.d.ts +383 -384
- package/dist/mod.js +1117 -2853
- package/dist-tests/{actor.test.js → actor.test.mjs} +315 -557
- package/dist-tests/{deno-BUQBaFF5.js → deno-Cb1qyeNy.mjs} +66 -145
- package/dist-tests/{lookup.test.js → lookup.test.mjs} +29 -48
- package/dist-tests/type-Cf-vxmre.mjs +9 -0
- package/dist-tests/type.test.mjs +16 -0
- package/dist-tests/{utils-BSWXlrig.js → utils-CE8Dk5hm.mjs} +3 -7
- package/dist-tests/{vocab-uMop7StC.js → vocab-uS-D0TBY.mjs} +1118 -2801
- package/dist-tests/{vocab.test.js → vocab.test.mjs} +100 -158
- package/package.json +6 -6
- package/dist-tests/type-CNuABalk.js +0 -13
- package/dist-tests/type.test.js +0 -24
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import { deno_default, esm_default } from "./deno-BUQBaFF5.js";
|
|
7
|
-
import { getTypeId } from "./type-CNuABalk.js";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
globalThis.addEventListener = () => {};
|
|
3
|
+
import { C as __exportAll, g as Person, h as Organization, l as Group, r as Application, y as Service } from "./vocab-uS-D0TBY.mjs";
|
|
4
|
+
import { n as version, r as esm_default, t as name } from "./deno-Cb1qyeNy.mjs";
|
|
5
|
+
import { t as getTypeId } from "./type-Cf-vxmre.mjs";
|
|
8
6
|
import { test } from "@fedify/fixture";
|
|
9
7
|
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert/strict";
|
|
10
8
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
11
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
12
10
|
import { domainToASCII, domainToUnicode } from "node:url";
|
|
13
|
-
|
|
14
11
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
|
|
15
12
|
var PreconditionFailure = class PreconditionFailure extends Error {
|
|
16
13
|
constructor(interruptExecution = false) {
|
|
@@ -23,7 +20,6 @@ var PreconditionFailure = class PreconditionFailure extends Error {
|
|
|
23
20
|
}
|
|
24
21
|
};
|
|
25
22
|
PreconditionFailure.SharedFootPrint = Symbol.for("fast-check/PreconditionFailure");
|
|
26
|
-
|
|
27
23
|
//#endregion
|
|
28
24
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/StreamHelpers.js
|
|
29
25
|
var Nil = class {
|
|
@@ -68,7 +64,6 @@ function* joinHelper(g, others) {
|
|
|
68
64
|
for (let cur = g.next(); !cur.done; cur = g.next()) yield cur.value;
|
|
69
65
|
for (const s of others) for (let cur = s.next(); !cur.done; cur = s.next()) yield cur.value;
|
|
70
66
|
}
|
|
71
|
-
|
|
72
67
|
//#endregion
|
|
73
68
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/Stream.js
|
|
74
69
|
const safeSymbolIterator = Symbol.iterator;
|
|
@@ -145,7 +140,6 @@ var Stream = class Stream {
|
|
|
145
140
|
function stream(g) {
|
|
146
141
|
return new Stream(g);
|
|
147
142
|
}
|
|
148
|
-
|
|
149
143
|
//#endregion
|
|
150
144
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/symbols.js
|
|
151
145
|
const cloneMethod = Symbol.for("fast-check/cloneMethod");
|
|
@@ -155,7 +149,6 @@ function hasCloneMethod(instance) {
|
|
|
155
149
|
function cloneIfNeeded(instance) {
|
|
156
150
|
return hasCloneMethod(instance) ? instance[cloneMethod]() : instance;
|
|
157
151
|
}
|
|
158
|
-
|
|
159
152
|
//#endregion
|
|
160
153
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/arbitrary/definition/Value.js
|
|
161
154
|
const safeObjectDefineProperty$2 = Object.defineProperty;
|
|
@@ -179,7 +172,6 @@ var Value = class {
|
|
|
179
172
|
return this.value_;
|
|
180
173
|
}
|
|
181
174
|
};
|
|
182
|
-
|
|
183
175
|
//#endregion
|
|
184
176
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/arbitrary/definition/Arbitrary.js
|
|
185
177
|
const safeObjectAssign$4 = Object.assign;
|
|
@@ -279,11 +271,10 @@ var MapArbitrary = class extends Arbitrary {
|
|
|
279
271
|
}
|
|
280
272
|
valueMapper(v) {
|
|
281
273
|
const [mappedValue, sourceValue] = this.mapperWithCloneIfNeeded(v);
|
|
282
|
-
|
|
274
|
+
return new Value(mappedValue, {
|
|
283
275
|
originalValue: sourceValue,
|
|
284
276
|
originalContext: v.context
|
|
285
|
-
};
|
|
286
|
-
return new Value(mappedValue, context);
|
|
277
|
+
});
|
|
287
278
|
}
|
|
288
279
|
isSafeContext(context) {
|
|
289
280
|
return context != null && typeof context === "object" && "originalValue" in context && "originalContext" in context;
|
|
@@ -354,7 +345,6 @@ function isArbitrary(instance) {
|
|
|
354
345
|
function assertIsArbitrary(instance) {
|
|
355
346
|
if (!isArbitrary(instance)) throw new Error("Unexpected value received: not an instance of Arbitrary");
|
|
356
347
|
}
|
|
357
|
-
|
|
358
348
|
//#endregion
|
|
359
349
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/apply.js
|
|
360
350
|
const untouchedApply = Function.prototype.apply;
|
|
@@ -363,7 +353,7 @@ function safeExtractApply(f) {
|
|
|
363
353
|
try {
|
|
364
354
|
return f.apply;
|
|
365
355
|
} catch (err) {
|
|
366
|
-
return
|
|
356
|
+
return;
|
|
367
357
|
}
|
|
368
358
|
}
|
|
369
359
|
function safeApplyHacky(f, instance, args) {
|
|
@@ -377,11 +367,10 @@ function safeApply(f, instance, args) {
|
|
|
377
367
|
if (safeExtractApply(f) === untouchedApply) return f.apply(instance, args);
|
|
378
368
|
return safeApplyHacky(f, instance, args);
|
|
379
369
|
}
|
|
380
|
-
|
|
381
370
|
//#endregion
|
|
382
371
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/globals.js
|
|
383
372
|
const SArray = typeof Array !== "undefined" ? Array : void 0;
|
|
384
|
-
const SBigInt = typeof BigInt !== "undefined" ? BigInt : void 0;
|
|
373
|
+
const SBigInt$1 = typeof BigInt !== "undefined" ? BigInt : void 0;
|
|
385
374
|
const SBoolean = typeof Boolean !== "undefined" ? Boolean : void 0;
|
|
386
375
|
const SDate = typeof Date !== "undefined" ? Date : void 0;
|
|
387
376
|
const SError = typeof Error !== "undefined" ? Error : void 0;
|
|
@@ -406,71 +395,71 @@ const untouchedMap = Array.prototype.map;
|
|
|
406
395
|
const untouchedFilter = Array.prototype.filter;
|
|
407
396
|
const untouchedPush = Array.prototype.push;
|
|
408
397
|
const untouchedPop = Array.prototype.pop;
|
|
409
|
-
|
|
398
|
+
Array.prototype.splice;
|
|
410
399
|
const untouchedSlice = Array.prototype.slice;
|
|
411
|
-
|
|
400
|
+
Array.prototype.sort;
|
|
412
401
|
const untouchedEvery = Array.prototype.every;
|
|
413
402
|
function extractForEach(instance) {
|
|
414
403
|
try {
|
|
415
404
|
return instance.forEach;
|
|
416
405
|
} catch (err) {
|
|
417
|
-
return
|
|
406
|
+
return;
|
|
418
407
|
}
|
|
419
408
|
}
|
|
420
409
|
function extractIndexOf(instance) {
|
|
421
410
|
try {
|
|
422
411
|
return instance.indexOf;
|
|
423
412
|
} catch (err) {
|
|
424
|
-
return
|
|
413
|
+
return;
|
|
425
414
|
}
|
|
426
415
|
}
|
|
427
416
|
function extractJoin(instance) {
|
|
428
417
|
try {
|
|
429
418
|
return instance.join;
|
|
430
419
|
} catch (err) {
|
|
431
|
-
return
|
|
420
|
+
return;
|
|
432
421
|
}
|
|
433
422
|
}
|
|
434
423
|
function extractMap(instance) {
|
|
435
424
|
try {
|
|
436
425
|
return instance.map;
|
|
437
426
|
} catch (err) {
|
|
438
|
-
return
|
|
427
|
+
return;
|
|
439
428
|
}
|
|
440
429
|
}
|
|
441
430
|
function extractFilter(instance) {
|
|
442
431
|
try {
|
|
443
432
|
return instance.filter;
|
|
444
433
|
} catch (err) {
|
|
445
|
-
return
|
|
434
|
+
return;
|
|
446
435
|
}
|
|
447
436
|
}
|
|
448
437
|
function extractPush(instance) {
|
|
449
438
|
try {
|
|
450
439
|
return instance.push;
|
|
451
440
|
} catch (err) {
|
|
452
|
-
return
|
|
441
|
+
return;
|
|
453
442
|
}
|
|
454
443
|
}
|
|
455
444
|
function extractPop(instance) {
|
|
456
445
|
try {
|
|
457
446
|
return instance.pop;
|
|
458
447
|
} catch (err) {
|
|
459
|
-
return
|
|
448
|
+
return;
|
|
460
449
|
}
|
|
461
450
|
}
|
|
462
451
|
function extractSlice(instance) {
|
|
463
452
|
try {
|
|
464
453
|
return instance.slice;
|
|
465
454
|
} catch (err) {
|
|
466
|
-
return
|
|
455
|
+
return;
|
|
467
456
|
}
|
|
468
457
|
}
|
|
469
458
|
function extractEvery(instance) {
|
|
470
459
|
try {
|
|
471
460
|
return instance.every;
|
|
472
461
|
} catch (err) {
|
|
473
|
-
return
|
|
462
|
+
return;
|
|
474
463
|
}
|
|
475
464
|
}
|
|
476
465
|
function safeForEach(instance, fn) {
|
|
@@ -515,14 +504,14 @@ function extractGetTime(instance) {
|
|
|
515
504
|
try {
|
|
516
505
|
return instance.getTime;
|
|
517
506
|
} catch (err) {
|
|
518
|
-
return
|
|
507
|
+
return;
|
|
519
508
|
}
|
|
520
509
|
}
|
|
521
510
|
function extractToISOString(instance) {
|
|
522
511
|
try {
|
|
523
512
|
return instance.toISOString;
|
|
524
513
|
} catch (err) {
|
|
525
|
-
return
|
|
514
|
+
return;
|
|
526
515
|
}
|
|
527
516
|
}
|
|
528
517
|
function safeGetTime(instance) {
|
|
@@ -539,14 +528,14 @@ function extractAdd(instance) {
|
|
|
539
528
|
try {
|
|
540
529
|
return instance.add;
|
|
541
530
|
} catch (err) {
|
|
542
|
-
return
|
|
531
|
+
return;
|
|
543
532
|
}
|
|
544
533
|
}
|
|
545
534
|
function extractHas(instance) {
|
|
546
535
|
try {
|
|
547
536
|
return instance.has;
|
|
548
537
|
} catch (err) {
|
|
549
|
-
return
|
|
538
|
+
return;
|
|
550
539
|
}
|
|
551
540
|
}
|
|
552
541
|
function safeAdd(instance, value) {
|
|
@@ -563,14 +552,14 @@ function extractSet(instance) {
|
|
|
563
552
|
try {
|
|
564
553
|
return instance.set;
|
|
565
554
|
} catch (err) {
|
|
566
|
-
return
|
|
555
|
+
return;
|
|
567
556
|
}
|
|
568
557
|
}
|
|
569
558
|
function extractGet(instance) {
|
|
570
559
|
try {
|
|
571
560
|
return instance.get;
|
|
572
561
|
} catch (err) {
|
|
573
|
-
return
|
|
562
|
+
return;
|
|
574
563
|
}
|
|
575
564
|
}
|
|
576
565
|
function safeSet(instance, key, value) {
|
|
@@ -587,14 +576,14 @@ function extractMapSet(instance) {
|
|
|
587
576
|
try {
|
|
588
577
|
return instance.set;
|
|
589
578
|
} catch (err) {
|
|
590
|
-
return
|
|
579
|
+
return;
|
|
591
580
|
}
|
|
592
581
|
}
|
|
593
582
|
function extractMapGet(instance) {
|
|
594
583
|
try {
|
|
595
584
|
return instance.get;
|
|
596
585
|
} catch (err) {
|
|
597
|
-
return
|
|
586
|
+
return;
|
|
598
587
|
}
|
|
599
588
|
}
|
|
600
589
|
function safeMapSet(instance, key, value) {
|
|
@@ -606,12 +595,12 @@ function safeMapGet(instance, key) {
|
|
|
606
595
|
return safeApply(untouchedMapGet, instance, [key]);
|
|
607
596
|
}
|
|
608
597
|
const untouchedSplit = String.prototype.split;
|
|
609
|
-
|
|
610
|
-
|
|
598
|
+
String.prototype.startsWith;
|
|
599
|
+
String.prototype.endsWith;
|
|
611
600
|
const untouchedSubstring = String.prototype.substring;
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
601
|
+
String.prototype.toLowerCase;
|
|
602
|
+
String.prototype.toUpperCase;
|
|
603
|
+
String.prototype.padStart;
|
|
615
604
|
const untouchedCharCodeAt = String.prototype.charCodeAt;
|
|
616
605
|
const untouchedNormalize = String.prototype.normalize;
|
|
617
606
|
const untouchedReplace = String.prototype.replace;
|
|
@@ -619,35 +608,35 @@ function extractSplit(instance) {
|
|
|
619
608
|
try {
|
|
620
609
|
return instance.split;
|
|
621
610
|
} catch (err) {
|
|
622
|
-
return
|
|
611
|
+
return;
|
|
623
612
|
}
|
|
624
613
|
}
|
|
625
614
|
function extractSubstring(instance) {
|
|
626
615
|
try {
|
|
627
616
|
return instance.substring;
|
|
628
617
|
} catch (err) {
|
|
629
|
-
return
|
|
618
|
+
return;
|
|
630
619
|
}
|
|
631
620
|
}
|
|
632
621
|
function extractCharCodeAt(instance) {
|
|
633
622
|
try {
|
|
634
623
|
return instance.charCodeAt;
|
|
635
624
|
} catch (err) {
|
|
636
|
-
return
|
|
625
|
+
return;
|
|
637
626
|
}
|
|
638
627
|
}
|
|
639
628
|
function extractNormalize(instance) {
|
|
640
629
|
try {
|
|
641
630
|
return instance.normalize;
|
|
642
631
|
} catch (err) {
|
|
643
|
-
return
|
|
632
|
+
return;
|
|
644
633
|
}
|
|
645
634
|
}
|
|
646
635
|
function extractReplace(instance) {
|
|
647
636
|
try {
|
|
648
637
|
return instance.replace;
|
|
649
638
|
} catch (err) {
|
|
650
|
-
return
|
|
639
|
+
return;
|
|
651
640
|
}
|
|
652
641
|
}
|
|
653
642
|
function safeSplit(instance, ...args) {
|
|
@@ -670,7 +659,7 @@ function safeReplace(instance, pattern, replacement) {
|
|
|
670
659
|
if (extractReplace(instance) === untouchedReplace) return instance.replace(pattern, replacement);
|
|
671
660
|
return safeApply(untouchedReplace, instance, [pattern, replacement]);
|
|
672
661
|
}
|
|
673
|
-
|
|
662
|
+
Number.prototype.toString;
|
|
674
663
|
const untouchedHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
675
664
|
const untouchedToString = Object.prototype.toString;
|
|
676
665
|
function safeHasOwnProperty(instance, v) {
|
|
@@ -679,7 +668,6 @@ function safeHasOwnProperty(instance, v) {
|
|
|
679
668
|
function safeToString(instance) {
|
|
680
669
|
return safeApply(untouchedToString, instance, []);
|
|
681
670
|
}
|
|
682
|
-
|
|
683
671
|
//#endregion
|
|
684
672
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/LazyIterableIterator.js
|
|
685
673
|
var LazyIterableIterator = class {
|
|
@@ -698,7 +686,6 @@ var LazyIterableIterator = class {
|
|
|
698
686
|
function makeLazy(producer) {
|
|
699
687
|
return new LazyIterableIterator(producer);
|
|
700
688
|
}
|
|
701
|
-
|
|
702
689
|
//#endregion
|
|
703
690
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/TupleArbitrary.js
|
|
704
691
|
const safeArrayIsArray$2 = Array.isArray;
|
|
@@ -728,7 +715,7 @@ function tupleShrink(arbs, value, context) {
|
|
|
728
715
|
const shrinks = [];
|
|
729
716
|
const safeContext = safeArrayIsArray$2(context) ? context : [];
|
|
730
717
|
for (let idx = 0; idx !== arbs.length; ++idx) safePush(shrinks, makeLazy(() => arbs[idx].shrink(value[idx], safeContext[idx]).map((v) => {
|
|
731
|
-
const nextValues = safeMap(value, (v
|
|
718
|
+
const nextValues = safeMap(value, (v, idx) => new Value(cloneIfNeeded(v), safeContext[idx]));
|
|
732
719
|
return [
|
|
733
720
|
...safeSlice(nextValues, 0, idx),
|
|
734
721
|
v,
|
|
@@ -760,27 +747,23 @@ var TupleArbitrary = class extends Arbitrary {
|
|
|
760
747
|
return tupleShrink(this.arbs, value, context);
|
|
761
748
|
}
|
|
762
749
|
};
|
|
763
|
-
|
|
764
750
|
//#endregion
|
|
765
751
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/tuple.js
|
|
766
752
|
function tuple(...arbs) {
|
|
767
753
|
return new TupleArbitrary(arbs);
|
|
768
754
|
}
|
|
769
|
-
|
|
770
755
|
//#endregion
|
|
771
756
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/IRawProperty.js
|
|
772
757
|
const safeMathLog$2 = Math.log;
|
|
773
758
|
function runIdToFrequency(runId) {
|
|
774
759
|
return 2 + ~~(safeMathLog$2(runId + 1) * .4342944819032518);
|
|
775
760
|
}
|
|
776
|
-
|
|
777
761
|
//#endregion
|
|
778
762
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/GlobalParameters.js
|
|
779
763
|
let globalParameters = {};
|
|
780
764
|
function readConfigureGlobal() {
|
|
781
765
|
return globalParameters;
|
|
782
766
|
}
|
|
783
|
-
|
|
784
767
|
//#endregion
|
|
785
768
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/NoUndefinedAsContext.js
|
|
786
769
|
const UndefinedContextPlaceholder = Symbol("UndefinedContextPlaceholder");
|
|
@@ -789,7 +772,6 @@ function noUndefinedAsContext(value) {
|
|
|
789
772
|
if (value.hasToBeCloned) return new Value(value.value_, UndefinedContextPlaceholder, () => value.value);
|
|
790
773
|
return new Value(value.value_, UndefinedContextPlaceholder);
|
|
791
774
|
}
|
|
792
|
-
|
|
793
775
|
//#endregion
|
|
794
776
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/AlwaysShrinkableArbitrary.js
|
|
795
777
|
var AlwaysShrinkableArbitrary = class extends Arbitrary {
|
|
@@ -798,8 +780,7 @@ var AlwaysShrinkableArbitrary = class extends Arbitrary {
|
|
|
798
780
|
this.arb = arb;
|
|
799
781
|
}
|
|
800
782
|
generate(mrng, biasFactor) {
|
|
801
|
-
|
|
802
|
-
return noUndefinedAsContext(value);
|
|
783
|
+
return noUndefinedAsContext(this.arb.generate(mrng, biasFactor));
|
|
803
784
|
}
|
|
804
785
|
canShrinkWithoutContext(value) {
|
|
805
786
|
return true;
|
|
@@ -810,7 +791,6 @@ var AlwaysShrinkableArbitrary = class extends Arbitrary {
|
|
|
810
791
|
return this.arb.shrink(value, safeContext).map(noUndefinedAsContext);
|
|
811
792
|
}
|
|
812
793
|
};
|
|
813
|
-
|
|
814
794
|
//#endregion
|
|
815
795
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/Property.generic.js
|
|
816
796
|
var Property = class Property {
|
|
@@ -827,8 +807,7 @@ var Property = class Property {
|
|
|
827
807
|
return false;
|
|
828
808
|
}
|
|
829
809
|
generate(mrng, runId) {
|
|
830
|
-
|
|
831
|
-
return noUndefinedAsContext(value);
|
|
810
|
+
return noUndefinedAsContext(this.arb.generate(mrng, runId != null ? runIdToFrequency(runId) : void 0));
|
|
832
811
|
}
|
|
833
812
|
shrink(value) {
|
|
834
813
|
if (value.context === void 0 && !this.arb.canShrinkWithoutContext(value.value_)) return Stream.nil();
|
|
@@ -875,7 +854,6 @@ var Property = class Property {
|
|
|
875
854
|
}
|
|
876
855
|
};
|
|
877
856
|
Property.dummyHook = () => {};
|
|
878
|
-
|
|
879
857
|
//#endregion
|
|
880
858
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/Property.js
|
|
881
859
|
function property(...args) {
|
|
@@ -883,10 +861,8 @@ function property(...args) {
|
|
|
883
861
|
const arbs = safeSlice(args, 0, args.length - 1);
|
|
884
862
|
const p = args[args.length - 1];
|
|
885
863
|
safeForEach(arbs, assertIsArbitrary);
|
|
886
|
-
|
|
887
|
-
return new Property(tuple(...mappedArbs), (t) => p(...t));
|
|
864
|
+
return new Property(tuple(...safeMap(arbs, (arb) => new AlwaysShrinkableArbitrary(arb))), (t) => p(...t));
|
|
888
865
|
}
|
|
889
|
-
|
|
890
866
|
//#endregion
|
|
891
867
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/RandomGenerator.js
|
|
892
868
|
function unsafeGenerateN(rng, num) {
|
|
@@ -896,8 +872,7 @@ function unsafeGenerateN(rng, num) {
|
|
|
896
872
|
}
|
|
897
873
|
function generateN(rng, num) {
|
|
898
874
|
var nextRng = rng.clone();
|
|
899
|
-
|
|
900
|
-
return [out, nextRng];
|
|
875
|
+
return [unsafeGenerateN(nextRng, num), nextRng];
|
|
901
876
|
}
|
|
902
877
|
function unsafeSkipN(rng, num) {
|
|
903
878
|
for (var idx = 0; idx != num; ++idx) rng.unsafeNext();
|
|
@@ -907,7 +882,6 @@ function skipN(rng, num) {
|
|
|
907
882
|
unsafeSkipN(nextRng, num);
|
|
908
883
|
return nextRng;
|
|
909
884
|
}
|
|
910
|
-
|
|
911
885
|
//#endregion
|
|
912
886
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/LinearCongruential.js
|
|
913
887
|
var MULTIPLIER = 214013;
|
|
@@ -921,44 +895,39 @@ var computeValueFromNextSeed = function(nextseed) {
|
|
|
921
895
|
return (nextseed & MASK_2) >> 16;
|
|
922
896
|
};
|
|
923
897
|
var LinearCongruential32 = function() {
|
|
924
|
-
function LinearCongruential32
|
|
898
|
+
function LinearCongruential32(seed) {
|
|
925
899
|
this.seed = seed;
|
|
926
900
|
}
|
|
927
|
-
LinearCongruential32
|
|
928
|
-
return new LinearCongruential32
|
|
901
|
+
LinearCongruential32.prototype.clone = function() {
|
|
902
|
+
return new LinearCongruential32(this.seed);
|
|
929
903
|
};
|
|
930
|
-
LinearCongruential32
|
|
931
|
-
var nextRng = new LinearCongruential32
|
|
932
|
-
|
|
933
|
-
return [out, nextRng];
|
|
904
|
+
LinearCongruential32.prototype.next = function() {
|
|
905
|
+
var nextRng = new LinearCongruential32(this.seed);
|
|
906
|
+
return [nextRng.unsafeNext(), nextRng];
|
|
934
907
|
};
|
|
935
|
-
LinearCongruential32
|
|
908
|
+
LinearCongruential32.prototype.unsafeNext = function() {
|
|
936
909
|
var s1 = computeNextSeed(this.seed);
|
|
937
910
|
var v1 = computeValueFromNextSeed(s1);
|
|
938
911
|
var s2 = computeNextSeed(s1);
|
|
939
912
|
var v2 = computeValueFromNextSeed(s2);
|
|
940
913
|
this.seed = computeNextSeed(s2);
|
|
941
|
-
|
|
942
|
-
var vnext = v3 + (v2 + (v1 << 15) << 15);
|
|
943
|
-
return vnext | 0;
|
|
914
|
+
return computeValueFromNextSeed(this.seed) + (v2 + (v1 << 15) << 15) | 0;
|
|
944
915
|
};
|
|
945
|
-
LinearCongruential32
|
|
916
|
+
LinearCongruential32.prototype.getState = function() {
|
|
946
917
|
return [this.seed];
|
|
947
918
|
};
|
|
948
|
-
return LinearCongruential32
|
|
919
|
+
return LinearCongruential32;
|
|
949
920
|
}();
|
|
950
921
|
function fromState$3(state) {
|
|
951
|
-
|
|
952
|
-
if (!valid) throw new Error("The state must have been produced by a congruential32 RandomGenerator");
|
|
922
|
+
if (!(state.length === 1)) throw new Error("The state must have been produced by a congruential32 RandomGenerator");
|
|
953
923
|
return new LinearCongruential32(state[0]);
|
|
954
924
|
}
|
|
955
925
|
var congruential32 = Object.assign(function(seed) {
|
|
956
926
|
return new LinearCongruential32(seed);
|
|
957
927
|
}, { fromState: fromState$3 });
|
|
958
|
-
|
|
959
928
|
//#endregion
|
|
960
929
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/MersenneTwister.js
|
|
961
|
-
var __read =
|
|
930
|
+
var __read = function(o, n) {
|
|
962
931
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
963
932
|
if (!m) return o;
|
|
964
933
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -975,7 +944,7 @@ var __read = void 0 && (void 0).__read || function(o, n) {
|
|
|
975
944
|
}
|
|
976
945
|
return ar;
|
|
977
946
|
};
|
|
978
|
-
var __spreadArray =
|
|
947
|
+
var __spreadArray = function(to, from, pack) {
|
|
979
948
|
if (pack || arguments.length === 2) {
|
|
980
949
|
for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
|
|
981
950
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
@@ -985,78 +954,76 @@ var __spreadArray = void 0 && (void 0).__spreadArray || function(to, from, pack)
|
|
|
985
954
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
986
955
|
};
|
|
987
956
|
var MersenneTwister = function() {
|
|
988
|
-
function MersenneTwister
|
|
957
|
+
function MersenneTwister(states, index) {
|
|
989
958
|
this.states = states;
|
|
990
959
|
this.index = index;
|
|
991
960
|
}
|
|
992
|
-
MersenneTwister
|
|
961
|
+
MersenneTwister.twist = function(prev) {
|
|
993
962
|
var mt = prev.slice();
|
|
994
|
-
for (var idx = 0; idx !== MersenneTwister
|
|
995
|
-
var y_1 = (mt[idx] & MersenneTwister
|
|
996
|
-
mt[idx] = mt[idx + MersenneTwister
|
|
963
|
+
for (var idx = 0; idx !== MersenneTwister.N - MersenneTwister.M; ++idx) {
|
|
964
|
+
var y_1 = (mt[idx] & MersenneTwister.MASK_UPPER) + (mt[idx + 1] & MersenneTwister.MASK_LOWER);
|
|
965
|
+
mt[idx] = mt[idx + MersenneTwister.M] ^ y_1 >>> 1 ^ -(y_1 & 1) & MersenneTwister.A;
|
|
997
966
|
}
|
|
998
|
-
for (var idx = MersenneTwister
|
|
999
|
-
var y_2 = (mt[idx] & MersenneTwister
|
|
1000
|
-
mt[idx] = mt[idx + MersenneTwister
|
|
967
|
+
for (var idx = MersenneTwister.N - MersenneTwister.M; idx !== MersenneTwister.N - 1; ++idx) {
|
|
968
|
+
var y_2 = (mt[idx] & MersenneTwister.MASK_UPPER) + (mt[idx + 1] & MersenneTwister.MASK_LOWER);
|
|
969
|
+
mt[idx] = mt[idx + MersenneTwister.M - MersenneTwister.N] ^ y_2 >>> 1 ^ -(y_2 & 1) & MersenneTwister.A;
|
|
1001
970
|
}
|
|
1002
|
-
var y = (mt[MersenneTwister
|
|
1003
|
-
mt[MersenneTwister
|
|
971
|
+
var y = (mt[MersenneTwister.N - 1] & MersenneTwister.MASK_UPPER) + (mt[0] & MersenneTwister.MASK_LOWER);
|
|
972
|
+
mt[MersenneTwister.N - 1] = mt[MersenneTwister.M - 1] ^ y >>> 1 ^ -(y & 1) & MersenneTwister.A;
|
|
1004
973
|
return mt;
|
|
1005
974
|
};
|
|
1006
|
-
MersenneTwister
|
|
1007
|
-
var out = Array(MersenneTwister
|
|
975
|
+
MersenneTwister.seeded = function(seed) {
|
|
976
|
+
var out = Array(MersenneTwister.N);
|
|
1008
977
|
out[0] = seed;
|
|
1009
|
-
for (var idx = 1; idx !== MersenneTwister
|
|
978
|
+
for (var idx = 1; idx !== MersenneTwister.N; ++idx) {
|
|
1010
979
|
var xored = out[idx - 1] ^ out[idx - 1] >>> 30;
|
|
1011
|
-
out[idx] = Math.imul(MersenneTwister
|
|
980
|
+
out[idx] = Math.imul(MersenneTwister.F, xored) + idx | 0;
|
|
1012
981
|
}
|
|
1013
982
|
return out;
|
|
1014
983
|
};
|
|
1015
|
-
MersenneTwister
|
|
1016
|
-
return new MersenneTwister
|
|
984
|
+
MersenneTwister.from = function(seed) {
|
|
985
|
+
return new MersenneTwister(MersenneTwister.twist(MersenneTwister.seeded(seed)), 0);
|
|
1017
986
|
};
|
|
1018
|
-
MersenneTwister
|
|
1019
|
-
return new MersenneTwister
|
|
987
|
+
MersenneTwister.prototype.clone = function() {
|
|
988
|
+
return new MersenneTwister(this.states, this.index);
|
|
1020
989
|
};
|
|
1021
|
-
MersenneTwister
|
|
1022
|
-
var nextRng = new MersenneTwister
|
|
1023
|
-
|
|
1024
|
-
return [out, nextRng];
|
|
990
|
+
MersenneTwister.prototype.next = function() {
|
|
991
|
+
var nextRng = new MersenneTwister(this.states, this.index);
|
|
992
|
+
return [nextRng.unsafeNext(), nextRng];
|
|
1025
993
|
};
|
|
1026
|
-
MersenneTwister
|
|
994
|
+
MersenneTwister.prototype.unsafeNext = function() {
|
|
1027
995
|
var y = this.states[this.index];
|
|
1028
|
-
y ^= this.states[this.index] >>> MersenneTwister
|
|
1029
|
-
y ^= y << MersenneTwister
|
|
1030
|
-
y ^= y << MersenneTwister
|
|
1031
|
-
y ^= y >>> MersenneTwister
|
|
1032
|
-
if (++this.index >= MersenneTwister
|
|
1033
|
-
this.states = MersenneTwister
|
|
996
|
+
y ^= this.states[this.index] >>> MersenneTwister.U;
|
|
997
|
+
y ^= y << MersenneTwister.S & MersenneTwister.B;
|
|
998
|
+
y ^= y << MersenneTwister.T & MersenneTwister.C;
|
|
999
|
+
y ^= y >>> MersenneTwister.L;
|
|
1000
|
+
if (++this.index >= MersenneTwister.N) {
|
|
1001
|
+
this.states = MersenneTwister.twist(this.states);
|
|
1034
1002
|
this.index = 0;
|
|
1035
1003
|
}
|
|
1036
1004
|
return y;
|
|
1037
1005
|
};
|
|
1038
|
-
MersenneTwister
|
|
1006
|
+
MersenneTwister.prototype.getState = function() {
|
|
1039
1007
|
return __spreadArray([this.index], __read(this.states), false);
|
|
1040
1008
|
};
|
|
1041
|
-
MersenneTwister
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
return new MersenneTwister$1(state.slice(1), state[0]);
|
|
1009
|
+
MersenneTwister.fromState = function(state) {
|
|
1010
|
+
if (!(state.length === MersenneTwister.N + 1 && state[0] >= 0 && state[0] < MersenneTwister.N)) throw new Error("The state must have been produced by a mersenne RandomGenerator");
|
|
1011
|
+
return new MersenneTwister(state.slice(1), state[0]);
|
|
1045
1012
|
};
|
|
1046
|
-
MersenneTwister
|
|
1047
|
-
MersenneTwister
|
|
1048
|
-
MersenneTwister
|
|
1049
|
-
MersenneTwister
|
|
1050
|
-
MersenneTwister
|
|
1051
|
-
MersenneTwister
|
|
1052
|
-
MersenneTwister
|
|
1053
|
-
MersenneTwister
|
|
1054
|
-
MersenneTwister
|
|
1055
|
-
MersenneTwister
|
|
1056
|
-
MersenneTwister
|
|
1057
|
-
MersenneTwister
|
|
1058
|
-
MersenneTwister
|
|
1059
|
-
return MersenneTwister
|
|
1013
|
+
MersenneTwister.N = 624;
|
|
1014
|
+
MersenneTwister.M = 397;
|
|
1015
|
+
MersenneTwister.R = 31;
|
|
1016
|
+
MersenneTwister.A = 2567483615;
|
|
1017
|
+
MersenneTwister.F = 1812433253;
|
|
1018
|
+
MersenneTwister.U = 11;
|
|
1019
|
+
MersenneTwister.S = 7;
|
|
1020
|
+
MersenneTwister.B = 2636928640;
|
|
1021
|
+
MersenneTwister.T = 15;
|
|
1022
|
+
MersenneTwister.C = 4022730752;
|
|
1023
|
+
MersenneTwister.L = 18;
|
|
1024
|
+
MersenneTwister.MASK_LOWER = Math.pow(2, MersenneTwister.R) - 1;
|
|
1025
|
+
MersenneTwister.MASK_UPPER = Math.pow(2, MersenneTwister.R);
|
|
1026
|
+
return MersenneTwister;
|
|
1060
1027
|
}();
|
|
1061
1028
|
function fromState$2(state) {
|
|
1062
1029
|
return MersenneTwister.fromState(state);
|
|
@@ -1064,25 +1031,23 @@ function fromState$2(state) {
|
|
|
1064
1031
|
var MersenneTwister_default = Object.assign(function(seed) {
|
|
1065
1032
|
return MersenneTwister.from(seed);
|
|
1066
1033
|
}, { fromState: fromState$2 });
|
|
1067
|
-
|
|
1068
1034
|
//#endregion
|
|
1069
1035
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/XorShift.js
|
|
1070
1036
|
var XorShift128Plus = function() {
|
|
1071
|
-
function XorShift128Plus
|
|
1037
|
+
function XorShift128Plus(s01, s00, s11, s10) {
|
|
1072
1038
|
this.s01 = s01;
|
|
1073
1039
|
this.s00 = s00;
|
|
1074
1040
|
this.s11 = s11;
|
|
1075
1041
|
this.s10 = s10;
|
|
1076
1042
|
}
|
|
1077
|
-
XorShift128Plus
|
|
1078
|
-
return new XorShift128Plus
|
|
1043
|
+
XorShift128Plus.prototype.clone = function() {
|
|
1044
|
+
return new XorShift128Plus(this.s01, this.s00, this.s11, this.s10);
|
|
1079
1045
|
};
|
|
1080
|
-
XorShift128Plus
|
|
1081
|
-
var nextRng = new XorShift128Plus
|
|
1082
|
-
|
|
1083
|
-
return [out, nextRng];
|
|
1046
|
+
XorShift128Plus.prototype.next = function() {
|
|
1047
|
+
var nextRng = new XorShift128Plus(this.s01, this.s00, this.s11, this.s10);
|
|
1048
|
+
return [nextRng.unsafeNext(), nextRng];
|
|
1084
1049
|
};
|
|
1085
|
-
XorShift128Plus
|
|
1050
|
+
XorShift128Plus.prototype.unsafeNext = function() {
|
|
1086
1051
|
var a0 = this.s00 ^ this.s00 << 23;
|
|
1087
1052
|
var a1 = this.s01 ^ (this.s01 << 23 | this.s00 >>> 9);
|
|
1088
1053
|
var b0 = a0 ^ this.s10 ^ (a0 >>> 18 | a1 << 14) ^ (this.s10 >>> 5 | this.s11 << 27);
|
|
@@ -1094,12 +1059,12 @@ var XorShift128Plus = function() {
|
|
|
1094
1059
|
this.s10 = b0;
|
|
1095
1060
|
return out;
|
|
1096
1061
|
};
|
|
1097
|
-
XorShift128Plus
|
|
1098
|
-
var nextRng = new XorShift128Plus
|
|
1062
|
+
XorShift128Plus.prototype.jump = function() {
|
|
1063
|
+
var nextRng = new XorShift128Plus(this.s01, this.s00, this.s11, this.s10);
|
|
1099
1064
|
nextRng.unsafeJump();
|
|
1100
1065
|
return nextRng;
|
|
1101
1066
|
};
|
|
1102
|
-
XorShift128Plus
|
|
1067
|
+
XorShift128Plus.prototype.unsafeJump = function() {
|
|
1103
1068
|
var ns01 = 0;
|
|
1104
1069
|
var ns00 = 0;
|
|
1105
1070
|
var ns11 = 0;
|
|
@@ -1124,7 +1089,7 @@ var XorShift128Plus = function() {
|
|
|
1124
1089
|
this.s11 = ns11;
|
|
1125
1090
|
this.s10 = ns10;
|
|
1126
1091
|
};
|
|
1127
|
-
XorShift128Plus
|
|
1092
|
+
XorShift128Plus.prototype.getState = function() {
|
|
1128
1093
|
return [
|
|
1129
1094
|
this.s01,
|
|
1130
1095
|
this.s00,
|
|
@@ -1132,35 +1097,32 @@ var XorShift128Plus = function() {
|
|
|
1132
1097
|
this.s10
|
|
1133
1098
|
];
|
|
1134
1099
|
};
|
|
1135
|
-
return XorShift128Plus
|
|
1100
|
+
return XorShift128Plus;
|
|
1136
1101
|
}();
|
|
1137
1102
|
function fromState$1(state) {
|
|
1138
|
-
|
|
1139
|
-
if (!valid) throw new Error("The state must have been produced by a xorshift128plus RandomGenerator");
|
|
1103
|
+
if (!(state.length === 4)) throw new Error("The state must have been produced by a xorshift128plus RandomGenerator");
|
|
1140
1104
|
return new XorShift128Plus(state[0], state[1], state[2], state[3]);
|
|
1141
1105
|
}
|
|
1142
1106
|
var xorshift128plus = Object.assign(function(seed) {
|
|
1143
1107
|
return new XorShift128Plus(-1, ~seed, seed | 0, 0);
|
|
1144
1108
|
}, { fromState: fromState$1 });
|
|
1145
|
-
|
|
1146
1109
|
//#endregion
|
|
1147
1110
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/XoroShiro.js
|
|
1148
1111
|
var XoroShiro128Plus = function() {
|
|
1149
|
-
function XoroShiro128Plus
|
|
1112
|
+
function XoroShiro128Plus(s01, s00, s11, s10) {
|
|
1150
1113
|
this.s01 = s01;
|
|
1151
1114
|
this.s00 = s00;
|
|
1152
1115
|
this.s11 = s11;
|
|
1153
1116
|
this.s10 = s10;
|
|
1154
1117
|
}
|
|
1155
|
-
XoroShiro128Plus
|
|
1156
|
-
return new XoroShiro128Plus
|
|
1118
|
+
XoroShiro128Plus.prototype.clone = function() {
|
|
1119
|
+
return new XoroShiro128Plus(this.s01, this.s00, this.s11, this.s10);
|
|
1157
1120
|
};
|
|
1158
|
-
XoroShiro128Plus
|
|
1159
|
-
var nextRng = new XoroShiro128Plus
|
|
1160
|
-
|
|
1161
|
-
return [out, nextRng];
|
|
1121
|
+
XoroShiro128Plus.prototype.next = function() {
|
|
1122
|
+
var nextRng = new XoroShiro128Plus(this.s01, this.s00, this.s11, this.s10);
|
|
1123
|
+
return [nextRng.unsafeNext(), nextRng];
|
|
1162
1124
|
};
|
|
1163
|
-
XoroShiro128Plus
|
|
1125
|
+
XoroShiro128Plus.prototype.unsafeNext = function() {
|
|
1164
1126
|
var out = this.s00 + this.s10 | 0;
|
|
1165
1127
|
var a0 = this.s10 ^ this.s00;
|
|
1166
1128
|
var a1 = this.s11 ^ this.s01;
|
|
@@ -1172,12 +1134,12 @@ var XoroShiro128Plus = function() {
|
|
|
1172
1134
|
this.s11 = a0 << 5 ^ a1 >>> 27;
|
|
1173
1135
|
return out;
|
|
1174
1136
|
};
|
|
1175
|
-
XoroShiro128Plus
|
|
1176
|
-
var nextRng = new XoroShiro128Plus
|
|
1137
|
+
XoroShiro128Plus.prototype.jump = function() {
|
|
1138
|
+
var nextRng = new XoroShiro128Plus(this.s01, this.s00, this.s11, this.s10);
|
|
1177
1139
|
nextRng.unsafeJump();
|
|
1178
1140
|
return nextRng;
|
|
1179
1141
|
};
|
|
1180
|
-
XoroShiro128Plus
|
|
1142
|
+
XoroShiro128Plus.prototype.unsafeJump = function() {
|
|
1181
1143
|
var ns01 = 0;
|
|
1182
1144
|
var ns00 = 0;
|
|
1183
1145
|
var ns11 = 0;
|
|
@@ -1202,7 +1164,7 @@ var XoroShiro128Plus = function() {
|
|
|
1202
1164
|
this.s11 = ns11;
|
|
1203
1165
|
this.s10 = ns10;
|
|
1204
1166
|
};
|
|
1205
|
-
XoroShiro128Plus
|
|
1167
|
+
XoroShiro128Plus.prototype.getState = function() {
|
|
1206
1168
|
return [
|
|
1207
1169
|
this.s01,
|
|
1208
1170
|
this.s00,
|
|
@@ -1210,17 +1172,15 @@ var XoroShiro128Plus = function() {
|
|
|
1210
1172
|
this.s10
|
|
1211
1173
|
];
|
|
1212
1174
|
};
|
|
1213
|
-
return XoroShiro128Plus
|
|
1175
|
+
return XoroShiro128Plus;
|
|
1214
1176
|
}();
|
|
1215
1177
|
function fromState(state) {
|
|
1216
|
-
|
|
1217
|
-
if (!valid) throw new Error("The state must have been produced by a xoroshiro128plus RandomGenerator");
|
|
1178
|
+
if (!(state.length === 4)) throw new Error("The state must have been produced by a xoroshiro128plus RandomGenerator");
|
|
1218
1179
|
return new XoroShiro128Plus(state[0], state[1], state[2], state[3]);
|
|
1219
1180
|
}
|
|
1220
1181
|
var xoroshiro128plus = Object.assign(function(seed) {
|
|
1221
1182
|
return new XoroShiro128Plus(-1, ~seed, seed | 0, 0);
|
|
1222
1183
|
}, { fromState });
|
|
1223
|
-
|
|
1224
1184
|
//#endregion
|
|
1225
1185
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js
|
|
1226
1186
|
function addArrayIntToNew(arrayIntA, arrayIntB) {
|
|
@@ -1233,9 +1193,7 @@ function addArrayIntToNew(arrayIntA, arrayIntB) {
|
|
|
1233
1193
|
var dataA = arrayIntA.data;
|
|
1234
1194
|
var dataB = arrayIntB.data;
|
|
1235
1195
|
for (var indexA = dataA.length - 1, indexB = dataB.length - 1; indexA >= 0 || indexB >= 0; --indexA, --indexB) {
|
|
1236
|
-
var
|
|
1237
|
-
var vB = indexB >= 0 ? dataB[indexB] : 0;
|
|
1238
|
-
var current = vA + vB + reminder;
|
|
1196
|
+
var current = (indexA >= 0 ? dataA[indexA] : 0) + (indexB >= 0 ? dataB[indexB] : 0) + reminder;
|
|
1239
1197
|
data.push(current >>> 0);
|
|
1240
1198
|
reminder = ~~(current / 4294967296);
|
|
1241
1199
|
}
|
|
@@ -1283,9 +1241,7 @@ function substractArrayIntToNew(arrayIntA, arrayIntB) {
|
|
|
1283
1241
|
var data = [];
|
|
1284
1242
|
var reminder = 0;
|
|
1285
1243
|
for (var indexA = dataA.length - 1, indexB = dataB.length - 1; indexA >= 0 || indexB >= 0; --indexA, --indexB) {
|
|
1286
|
-
var
|
|
1287
|
-
var vB = indexB >= 0 ? dataB[indexB] : 0;
|
|
1288
|
-
var current = vA - vB - reminder;
|
|
1244
|
+
var current = (indexA >= 0 ? dataA[indexA] : 0) - (indexB >= 0 ? dataB[indexB] : 0) - reminder;
|
|
1289
1245
|
data.push(current >>> 0);
|
|
1290
1246
|
reminder = current < 0 ? 1 : 0;
|
|
1291
1247
|
}
|
|
@@ -1354,7 +1310,6 @@ function substractArrayInt64(out, arrayIntA, arrayIntB) {
|
|
|
1354
1310
|
out.data[1] = low;
|
|
1355
1311
|
return out;
|
|
1356
1312
|
}
|
|
1357
|
-
|
|
1358
1313
|
//#endregion
|
|
1359
1314
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformIntDistributionInternal.js
|
|
1360
1315
|
function unsafeUniformIntDistributionInternal(rangeSize, rng) {
|
|
@@ -1363,17 +1318,12 @@ function unsafeUniformIntDistributionInternal(rangeSize, rng) {
|
|
|
1363
1318
|
while (deltaV >= MaxAllowed) deltaV = rng.unsafeNext() + 2147483648;
|
|
1364
1319
|
return deltaV % rangeSize;
|
|
1365
1320
|
}
|
|
1366
|
-
|
|
1367
1321
|
//#endregion
|
|
1368
1322
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js
|
|
1369
1323
|
function unsafeUniformArrayIntDistributionInternal(out, rangeSize, rng) {
|
|
1370
1324
|
var rangeLength = rangeSize.length;
|
|
1371
1325
|
while (true) {
|
|
1372
|
-
for (var index = 0; index !== rangeLength; ++index)
|
|
1373
|
-
var indexRangeSize = index === 0 ? rangeSize[0] + 1 : 4294967296;
|
|
1374
|
-
var g = unsafeUniformIntDistributionInternal(indexRangeSize, rng);
|
|
1375
|
-
out[index] = g;
|
|
1376
|
-
}
|
|
1326
|
+
for (var index = 0; index !== rangeLength; ++index) out[index] = unsafeUniformIntDistributionInternal(index === 0 ? rangeSize[0] + 1 : 4294967296, rng);
|
|
1377
1327
|
for (var index = 0; index !== rangeLength; ++index) {
|
|
1378
1328
|
var current = out[index];
|
|
1379
1329
|
var currentInRange = rangeSize[index];
|
|
@@ -1382,19 +1332,15 @@ function unsafeUniformArrayIntDistributionInternal(out, rangeSize, rng) {
|
|
|
1382
1332
|
}
|
|
1383
1333
|
}
|
|
1384
1334
|
}
|
|
1385
|
-
|
|
1386
1335
|
//#endregion
|
|
1387
1336
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformArrayIntDistribution.js
|
|
1388
1337
|
function unsafeUniformArrayIntDistribution(from, to, rng) {
|
|
1389
1338
|
var rangeSize = trimArrayIntInplace(addOneToPositiveArrayInt(substractArrayIntToNew(to, from)));
|
|
1390
|
-
var emptyArrayIntData = rangeSize.data.slice(0);
|
|
1391
|
-
var g = unsafeUniformArrayIntDistributionInternal(emptyArrayIntData, rangeSize.data, rng);
|
|
1392
1339
|
return trimArrayIntInplace(addArrayIntToNew({
|
|
1393
1340
|
sign: 1,
|
|
1394
|
-
data:
|
|
1341
|
+
data: unsafeUniformArrayIntDistributionInternal(rangeSize.data.slice(0), rangeSize.data, rng)
|
|
1395
1342
|
}, from));
|
|
1396
1343
|
}
|
|
1397
|
-
|
|
1398
1344
|
//#endregion
|
|
1399
1345
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js
|
|
1400
1346
|
function uniformArrayIntDistribution(from, to, rng) {
|
|
@@ -1402,19 +1348,18 @@ function uniformArrayIntDistribution(from, to, rng) {
|
|
|
1402
1348
|
var nextRng = rng.clone();
|
|
1403
1349
|
return [unsafeUniformArrayIntDistribution(from, to, nextRng), nextRng];
|
|
1404
1350
|
}
|
|
1405
|
-
return function(rng
|
|
1406
|
-
var nextRng
|
|
1407
|
-
return [unsafeUniformArrayIntDistribution(from, to, nextRng
|
|
1351
|
+
return function(rng) {
|
|
1352
|
+
var nextRng = rng.clone();
|
|
1353
|
+
return [unsafeUniformArrayIntDistribution(from, to, nextRng), nextRng];
|
|
1408
1354
|
};
|
|
1409
1355
|
}
|
|
1410
|
-
|
|
1411
1356
|
//#endregion
|
|
1412
1357
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js
|
|
1413
|
-
var SBigInt
|
|
1358
|
+
var SBigInt = typeof BigInt !== "undefined" ? BigInt : void 0;
|
|
1414
1359
|
function unsafeUniformBigIntDistribution(from, to, rng) {
|
|
1415
|
-
var diff = to - from + SBigInt
|
|
1416
|
-
var MinRng = SBigInt
|
|
1417
|
-
var NumValues = SBigInt
|
|
1360
|
+
var diff = to - from + SBigInt(1);
|
|
1361
|
+
var MinRng = SBigInt(-2147483648);
|
|
1362
|
+
var NumValues = SBigInt(4294967296);
|
|
1418
1363
|
var FinalNumValues = NumValues;
|
|
1419
1364
|
var NumIterations = 1;
|
|
1420
1365
|
while (FinalNumValues < diff) {
|
|
@@ -1423,18 +1368,14 @@ function unsafeUniformBigIntDistribution(from, to, rng) {
|
|
|
1423
1368
|
}
|
|
1424
1369
|
var MaxAcceptedRandom = FinalNumValues - FinalNumValues % diff;
|
|
1425
1370
|
while (true) {
|
|
1426
|
-
var value = SBigInt
|
|
1371
|
+
var value = SBigInt(0);
|
|
1427
1372
|
for (var num = 0; num !== NumIterations; ++num) {
|
|
1428
1373
|
var out = rng.unsafeNext();
|
|
1429
|
-
value = NumValues * value + (SBigInt
|
|
1430
|
-
}
|
|
1431
|
-
if (value < MaxAcceptedRandom) {
|
|
1432
|
-
var inDiff = value % diff;
|
|
1433
|
-
return inDiff + from;
|
|
1374
|
+
value = NumValues * value + (SBigInt(out) - MinRng);
|
|
1434
1375
|
}
|
|
1376
|
+
if (value < MaxAcceptedRandom) return value % diff + from;
|
|
1435
1377
|
}
|
|
1436
1378
|
}
|
|
1437
|
-
|
|
1438
1379
|
//#endregion
|
|
1439
1380
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformBigIntDistribution.js
|
|
1440
1381
|
function uniformBigIntDistribution(from, to, rng) {
|
|
@@ -1442,12 +1383,11 @@ function uniformBigIntDistribution(from, to, rng) {
|
|
|
1442
1383
|
var nextRng = rng.clone();
|
|
1443
1384
|
return [unsafeUniformBigIntDistribution(from, to, nextRng), nextRng];
|
|
1444
1385
|
}
|
|
1445
|
-
return function(rng
|
|
1446
|
-
var nextRng
|
|
1447
|
-
return [unsafeUniformBigIntDistribution(from, to, nextRng
|
|
1386
|
+
return function(rng) {
|
|
1387
|
+
var nextRng = rng.clone();
|
|
1388
|
+
return [unsafeUniformBigIntDistribution(from, to, nextRng), nextRng];
|
|
1448
1389
|
};
|
|
1449
1390
|
}
|
|
1450
|
-
|
|
1451
1391
|
//#endregion
|
|
1452
1392
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js
|
|
1453
1393
|
var safeNumberMaxSafeInteger = Number.MAX_SAFE_INTEGER;
|
|
@@ -1475,13 +1415,9 @@ function uniformLargeIntInternal(from, to, rangeSize, rng) {
|
|
|
1475
1415
|
}
|
|
1476
1416
|
function unsafeUniformIntDistribution(from, to, rng) {
|
|
1477
1417
|
var rangeSize = to - from;
|
|
1478
|
-
if (rangeSize <= 4294967295)
|
|
1479
|
-
var g = unsafeUniformIntDistributionInternal(rangeSize + 1, rng);
|
|
1480
|
-
return g + from;
|
|
1481
|
-
}
|
|
1418
|
+
if (rangeSize <= 4294967295) return unsafeUniformIntDistributionInternal(rangeSize + 1, rng) + from;
|
|
1482
1419
|
return uniformLargeIntInternal(from, to, rangeSize, rng);
|
|
1483
1420
|
}
|
|
1484
|
-
|
|
1485
1421
|
//#endregion
|
|
1486
1422
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js
|
|
1487
1423
|
function uniformIntDistribution(from, to, rng) {
|
|
@@ -1489,16 +1425,14 @@ function uniformIntDistribution(from, to, rng) {
|
|
|
1489
1425
|
var nextRng = rng.clone();
|
|
1490
1426
|
return [unsafeUniformIntDistribution(from, to, nextRng), nextRng];
|
|
1491
1427
|
}
|
|
1492
|
-
return function(rng
|
|
1493
|
-
var nextRng
|
|
1494
|
-
return [unsafeUniformIntDistribution(from, to, nextRng
|
|
1428
|
+
return function(rng) {
|
|
1429
|
+
var nextRng = rng.clone();
|
|
1430
|
+
return [unsafeUniformIntDistribution(from, to, nextRng), nextRng];
|
|
1495
1431
|
};
|
|
1496
1432
|
}
|
|
1497
|
-
|
|
1498
1433
|
//#endregion
|
|
1499
1434
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/pure-rand-default.js
|
|
1500
|
-
var pure_rand_default_exports = {
|
|
1501
|
-
__export(pure_rand_default_exports, {
|
|
1435
|
+
var pure_rand_default_exports = /* @__PURE__ */ __exportAll({
|
|
1502
1436
|
__commitHash: () => __commitHash,
|
|
1503
1437
|
__type: () => __type,
|
|
1504
1438
|
__version: () => __version,
|
|
@@ -1520,20 +1454,17 @@ __export(pure_rand_default_exports, {
|
|
|
1520
1454
|
var __type = "module";
|
|
1521
1455
|
var __version = "6.1.0";
|
|
1522
1456
|
var __commitHash = "a413dd2b721516be2ef29adffb515c5ae67bfbad";
|
|
1523
|
-
|
|
1524
1457
|
//#endregion
|
|
1525
1458
|
//#region ../../node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/pure-rand.js
|
|
1526
1459
|
var pure_rand_default = pure_rand_default_exports;
|
|
1527
|
-
|
|
1528
1460
|
//#endregion
|
|
1529
1461
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/VerbosityLevel.js
|
|
1530
1462
|
var VerbosityLevel;
|
|
1531
|
-
(function(VerbosityLevel
|
|
1532
|
-
VerbosityLevel
|
|
1533
|
-
VerbosityLevel
|
|
1534
|
-
VerbosityLevel
|
|
1463
|
+
(function(VerbosityLevel) {
|
|
1464
|
+
VerbosityLevel[VerbosityLevel["None"] = 0] = "None";
|
|
1465
|
+
VerbosityLevel[VerbosityLevel["Verbose"] = 1] = "Verbose";
|
|
1466
|
+
VerbosityLevel[VerbosityLevel["VeryVerbose"] = 2] = "VeryVerbose";
|
|
1535
1467
|
})(VerbosityLevel || (VerbosityLevel = {}));
|
|
1536
|
-
|
|
1537
1468
|
//#endregion
|
|
1538
1469
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/QualifiedParameters.js
|
|
1539
1470
|
const safeDateNow$1 = Date.now;
|
|
@@ -1566,7 +1497,7 @@ var QualifiedParameters = class QualifiedParameters {
|
|
|
1566
1497
|
}
|
|
1567
1498
|
toParameters() {
|
|
1568
1499
|
const orUndefined = (value) => value !== null ? value : void 0;
|
|
1569
|
-
|
|
1500
|
+
return {
|
|
1570
1501
|
seed: this.seed,
|
|
1571
1502
|
randomType: this.randomType,
|
|
1572
1503
|
numRuns: this.numRuns,
|
|
@@ -1587,7 +1518,6 @@ var QualifiedParameters = class QualifiedParameters {
|
|
|
1587
1518
|
asyncReporter: orUndefined(this.asyncReporter),
|
|
1588
1519
|
errorWithCause: this.errorWithCause
|
|
1589
1520
|
};
|
|
1590
|
-
return parameters;
|
|
1591
1521
|
}
|
|
1592
1522
|
static read(op) {
|
|
1593
1523
|
return new QualifiedParameters(op);
|
|
@@ -1604,8 +1534,7 @@ QualifiedParameters.readSeed = (p) => {
|
|
|
1604
1534
|
if (p.seed == null) return safeDateNow$1() ^ safeMathRandom() * 4294967296;
|
|
1605
1535
|
const seed32 = p.seed | 0;
|
|
1606
1536
|
if (p.seed === seed32) return seed32;
|
|
1607
|
-
|
|
1608
|
-
return seed32 ^ gap * 4294967296;
|
|
1537
|
+
return seed32 ^ (p.seed - seed32) * 4294967296;
|
|
1609
1538
|
};
|
|
1610
1539
|
QualifiedParameters.readRandomType = (p) => {
|
|
1611
1540
|
if (p.randomType == null) return pure_rand_default.xorshift128plus;
|
|
@@ -1645,25 +1574,22 @@ QualifiedParameters.safeTimeout = (value) => {
|
|
|
1645
1574
|
if (value === null) return null;
|
|
1646
1575
|
return safeMathMin$5(value, 2147483647);
|
|
1647
1576
|
};
|
|
1648
|
-
|
|
1649
1577
|
//#endregion
|
|
1650
1578
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/SkipAfterProperty.js
|
|
1651
1579
|
function interruptAfter(timeMs, setTimeoutSafe, clearTimeoutSafe) {
|
|
1652
1580
|
let timeoutHandle = null;
|
|
1653
|
-
const promise = new Promise((resolve) => {
|
|
1654
|
-
timeoutHandle = setTimeoutSafe(() => {
|
|
1655
|
-
const preconditionFailure = new PreconditionFailure(true);
|
|
1656
|
-
resolve(preconditionFailure);
|
|
1657
|
-
}, timeMs);
|
|
1658
|
-
});
|
|
1659
1581
|
return {
|
|
1660
1582
|
clear: () => clearTimeoutSafe(timeoutHandle),
|
|
1661
|
-
promise
|
|
1583
|
+
promise: new Promise((resolve) => {
|
|
1584
|
+
timeoutHandle = setTimeoutSafe(() => {
|
|
1585
|
+
resolve(new PreconditionFailure(true));
|
|
1586
|
+
}, timeMs);
|
|
1587
|
+
})
|
|
1662
1588
|
};
|
|
1663
1589
|
}
|
|
1664
1590
|
var SkipAfterProperty = class {
|
|
1665
|
-
constructor(property
|
|
1666
|
-
this.property = property
|
|
1591
|
+
constructor(property, getTime, timeLimit, interruptExecution, setTimeoutSafe, clearTimeoutSafe) {
|
|
1592
|
+
this.property = property;
|
|
1667
1593
|
this.getTime = getTime;
|
|
1668
1594
|
this.interruptExecution = interruptExecution;
|
|
1669
1595
|
this.setTimeoutSafe = setTimeoutSafe;
|
|
@@ -1699,27 +1625,25 @@ var SkipAfterProperty = class {
|
|
|
1699
1625
|
return this.property.run(v, dontRunHook);
|
|
1700
1626
|
}
|
|
1701
1627
|
};
|
|
1702
|
-
|
|
1703
1628
|
//#endregion
|
|
1704
1629
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/TimeoutProperty.js
|
|
1705
1630
|
const timeoutAfter = (timeMs, setTimeoutSafe, clearTimeoutSafe) => {
|
|
1706
1631
|
let timeoutHandle = null;
|
|
1707
|
-
const promise = new Promise((resolve) => {
|
|
1708
|
-
timeoutHandle = setTimeoutSafe(() => {
|
|
1709
|
-
resolve({
|
|
1710
|
-
error: new SError(`Property timeout: exceeded limit of ${timeMs} milliseconds`),
|
|
1711
|
-
errorMessage: `Property timeout: exceeded limit of ${timeMs} milliseconds`
|
|
1712
|
-
});
|
|
1713
|
-
}, timeMs);
|
|
1714
|
-
});
|
|
1715
1632
|
return {
|
|
1716
1633
|
clear: () => clearTimeoutSafe(timeoutHandle),
|
|
1717
|
-
promise
|
|
1634
|
+
promise: new Promise((resolve) => {
|
|
1635
|
+
timeoutHandle = setTimeoutSafe(() => {
|
|
1636
|
+
resolve({
|
|
1637
|
+
error: new SError(`Property timeout: exceeded limit of ${timeMs} milliseconds`),
|
|
1638
|
+
errorMessage: `Property timeout: exceeded limit of ${timeMs} milliseconds`
|
|
1639
|
+
});
|
|
1640
|
+
}, timeMs);
|
|
1641
|
+
})
|
|
1718
1642
|
};
|
|
1719
1643
|
};
|
|
1720
1644
|
var TimeoutProperty = class {
|
|
1721
|
-
constructor(property
|
|
1722
|
-
this.property = property
|
|
1645
|
+
constructor(property, timeMs, setTimeoutSafe, clearTimeoutSafe) {
|
|
1646
|
+
this.property = property;
|
|
1723
1647
|
this.timeMs = timeMs;
|
|
1724
1648
|
this.setTimeoutSafe = setTimeoutSafe;
|
|
1725
1649
|
this.clearTimeoutSafe = clearTimeoutSafe;
|
|
@@ -1744,12 +1668,11 @@ var TimeoutProperty = class {
|
|
|
1744
1668
|
return propRun;
|
|
1745
1669
|
}
|
|
1746
1670
|
};
|
|
1747
|
-
|
|
1748
1671
|
//#endregion
|
|
1749
1672
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/UnbiasedProperty.js
|
|
1750
1673
|
var UnbiasedProperty = class {
|
|
1751
|
-
constructor(property
|
|
1752
|
-
this.property = property
|
|
1674
|
+
constructor(property) {
|
|
1675
|
+
this.property = property;
|
|
1753
1676
|
if (this.property.runBeforeEach !== void 0 && this.property.runAfterEach !== void 0) {
|
|
1754
1677
|
this.runBeforeEach = () => this.property.runBeforeEach();
|
|
1755
1678
|
this.runAfterEach = () => this.property.runAfterEach();
|
|
@@ -1768,7 +1691,6 @@ var UnbiasedProperty = class {
|
|
|
1768
1691
|
return this.property.run(v, dontRunHook);
|
|
1769
1692
|
}
|
|
1770
1693
|
};
|
|
1771
|
-
|
|
1772
1694
|
//#endregion
|
|
1773
1695
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/stringify.js
|
|
1774
1696
|
const safeArrayFrom = Array.from;
|
|
@@ -1855,11 +1777,10 @@ function stringifyInternal(value, previousValues, getAsyncContent) {
|
|
|
1855
1777
|
return "[object Object]";
|
|
1856
1778
|
}
|
|
1857
1779
|
const mapper = (k) => `${k === "__proto__" ? "[\"__proto__\"]" : typeof k === "symbol" ? `[${stringifyInternal(k, currentValues, getAsyncContent)}]` : safeJsonStringify(k)}:${stringifyInternal(value[k], currentValues, getAsyncContent)}`;
|
|
1858
|
-
const
|
|
1780
|
+
const rawRepr = "{" + safeJoin([...safeMap(safeObjectKeys(value), mapper), ...safeMap(safeFilter(safeObjectGetOwnPropertySymbols$1(value), (s) => {
|
|
1859
1781
|
const descriptor = safeObjectGetOwnPropertyDescriptor$1(value, s);
|
|
1860
1782
|
return descriptor && descriptor.enumerable;
|
|
1861
|
-
}), mapper)];
|
|
1862
|
-
const rawRepr = "{" + safeJoin(stringifiedProperties, ",") + "}";
|
|
1783
|
+
}), mapper)], ",") + "}";
|
|
1863
1784
|
if (safeObjectGetPrototypeOf$1(value) === null) return rawRepr === "{}" ? "Object.create(null)" : `Object.assign(Object.create(null),${rawRepr})`;
|
|
1864
1785
|
return rawRepr;
|
|
1865
1786
|
}
|
|
@@ -1870,8 +1791,7 @@ function stringifyInternal(value, previousValues, getAsyncContent) {
|
|
|
1870
1791
|
if (SSymbol.keyFor(s) !== void 0) return `Symbol.for(${safeJsonStringify(SSymbol.keyFor(s))})`;
|
|
1871
1792
|
const desc = getSymbolDescription(s);
|
|
1872
1793
|
if (desc === null) return "Symbol()";
|
|
1873
|
-
|
|
1874
|
-
return s === knownSymbol ? desc : `Symbol(${safeJsonStringify(desc)})`;
|
|
1794
|
+
return s === (desc.startsWith("Symbol.") && SSymbol[desc.substring(7)]) ? desc : `Symbol(${safeJsonStringify(desc)})`;
|
|
1875
1795
|
}
|
|
1876
1796
|
case "[object Promise]": {
|
|
1877
1797
|
const promiseContent = getAsyncContent(value);
|
|
@@ -1879,7 +1799,6 @@ function stringifyInternal(value, previousValues, getAsyncContent) {
|
|
|
1879
1799
|
case "fulfilled": return `Promise.resolve(${stringifyInternal(promiseContent.value, currentValues, getAsyncContent)})`;
|
|
1880
1800
|
case "rejected": return `Promise.reject(${stringifyInternal(promiseContent.value, currentValues, getAsyncContent)})`;
|
|
1881
1801
|
case "pending": return `new Promise(() => {/*pending*/})`;
|
|
1882
|
-
case "unknown":
|
|
1883
1802
|
default: return `new Promise(() => {/*unknown*/})`;
|
|
1884
1803
|
}
|
|
1885
1804
|
}
|
|
@@ -1901,11 +1820,7 @@ function stringifyInternal(value, previousValues, getAsyncContent) {
|
|
|
1901
1820
|
if (typeof safeBufferIsBuffer === "function" && safeBufferIsBuffer(value)) return `Buffer.from(${stringifyInternal(safeArrayFrom(value.values()), currentValues, getAsyncContent)})`;
|
|
1902
1821
|
const valuePrototype = safeObjectGetPrototypeOf$1(value);
|
|
1903
1822
|
const className = valuePrototype && valuePrototype.constructor && valuePrototype.constructor.name;
|
|
1904
|
-
if (typeof className === "string") {
|
|
1905
|
-
const typedArray$1 = value;
|
|
1906
|
-
const valuesFromTypedArr = typedArray$1.values();
|
|
1907
|
-
return `${className}.from(${stringifyInternal(safeArrayFrom(valuesFromTypedArr), currentValues, getAsyncContent)})`;
|
|
1908
|
-
}
|
|
1823
|
+
if (typeof className === "string") return `${className}.from(${stringifyInternal(safeArrayFrom(value.values()), currentValues, getAsyncContent)})`;
|
|
1909
1824
|
break;
|
|
1910
1825
|
}
|
|
1911
1826
|
}
|
|
@@ -1930,14 +1845,13 @@ function possiblyAsyncStringify(value) {
|
|
|
1930
1845
|
const cancel = () => {
|
|
1931
1846
|
if (handleId !== null) clearTimeout(handleId);
|
|
1932
1847
|
};
|
|
1933
|
-
const delay = new Promise((resolve) => {
|
|
1934
|
-
handleId = setTimeout(() => {
|
|
1935
|
-
handleId = null;
|
|
1936
|
-
resolve(stillPendingMarker);
|
|
1937
|
-
}, 0);
|
|
1938
|
-
});
|
|
1939
1848
|
return {
|
|
1940
|
-
delay
|
|
1849
|
+
delay: new Promise((resolve) => {
|
|
1850
|
+
handleId = setTimeout(() => {
|
|
1851
|
+
handleId = null;
|
|
1852
|
+
resolve(stillPendingMarker);
|
|
1853
|
+
}, 0);
|
|
1854
|
+
}),
|
|
1941
1855
|
cancel
|
|
1942
1856
|
};
|
|
1943
1857
|
}
|
|
@@ -1945,7 +1859,7 @@ function possiblyAsyncStringify(value) {
|
|
|
1945
1859
|
state: "unknown",
|
|
1946
1860
|
value: void 0
|
|
1947
1861
|
};
|
|
1948
|
-
const getAsyncContent = function getAsyncContent
|
|
1862
|
+
const getAsyncContent = function getAsyncContent(data) {
|
|
1949
1863
|
const cacheKey = data;
|
|
1950
1864
|
if (cache.has(cacheKey)) return cache.get(cacheKey);
|
|
1951
1865
|
const delay0 = createDelay0();
|
|
@@ -1978,7 +1892,6 @@ function possiblyAsyncStringify(value) {
|
|
|
1978
1892
|
}
|
|
1979
1893
|
return loop();
|
|
1980
1894
|
}
|
|
1981
|
-
|
|
1982
1895
|
//#endregion
|
|
1983
1896
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/IgnoreEqualValuesProperty.js
|
|
1984
1897
|
function fromSyncCached(cachedValue) {
|
|
@@ -1992,8 +1905,8 @@ function fromCachedUnsafe(cachedValue, isAsync) {
|
|
|
1992
1905
|
return fromCached(cachedValue, isAsync);
|
|
1993
1906
|
}
|
|
1994
1907
|
var IgnoreEqualValuesProperty = class {
|
|
1995
|
-
constructor(property
|
|
1996
|
-
this.property = property
|
|
1908
|
+
constructor(property, skipRuns) {
|
|
1909
|
+
this.property = property;
|
|
1997
1910
|
this.skipRuns = skipRuns;
|
|
1998
1911
|
this.coveredCases = /* @__PURE__ */ new Map();
|
|
1999
1912
|
if (this.property.runBeforeEach !== void 0 && this.property.runAfterEach !== void 0) {
|
|
@@ -2022,7 +1935,6 @@ var IgnoreEqualValuesProperty = class {
|
|
|
2022
1935
|
return out;
|
|
2023
1936
|
}
|
|
2024
1937
|
};
|
|
2025
|
-
|
|
2026
1938
|
//#endregion
|
|
2027
1939
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/DecorateProperty.js
|
|
2028
1940
|
const safeDateNow = Date.now;
|
|
@@ -2038,16 +1950,14 @@ function decorateProperty(rawProperty, qParams) {
|
|
|
2038
1950
|
if (qParams.ignoreEqualValues) prop = new IgnoreEqualValuesProperty(prop, false);
|
|
2039
1951
|
return prop;
|
|
2040
1952
|
}
|
|
2041
|
-
|
|
2042
1953
|
//#endregion
|
|
2043
1954
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/reporter/ExecutionStatus.js
|
|
2044
1955
|
var ExecutionStatus;
|
|
2045
|
-
(function(ExecutionStatus
|
|
2046
|
-
ExecutionStatus
|
|
2047
|
-
ExecutionStatus
|
|
2048
|
-
ExecutionStatus
|
|
1956
|
+
(function(ExecutionStatus) {
|
|
1957
|
+
ExecutionStatus[ExecutionStatus["Success"] = 0] = "Success";
|
|
1958
|
+
ExecutionStatus[ExecutionStatus["Skipped"] = -1] = "Skipped";
|
|
1959
|
+
ExecutionStatus[ExecutionStatus["Failure"] = 1] = "Failure";
|
|
2049
1960
|
})(ExecutionStatus || (ExecutionStatus = {}));
|
|
2050
|
-
|
|
2051
1961
|
//#endregion
|
|
2052
1962
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/reporter/RunExecution.js
|
|
2053
1963
|
var RunExecution = class RunExecution {
|
|
@@ -2074,10 +1984,7 @@ var RunExecution = class RunExecution {
|
|
|
2074
1984
|
return currentTree;
|
|
2075
1985
|
}
|
|
2076
1986
|
fail(value, id, failure) {
|
|
2077
|
-
if (this.verbosity >= VerbosityLevel.Verbose)
|
|
2078
|
-
const currentTree = this.appendExecutionTree(ExecutionStatus.Failure, value);
|
|
2079
|
-
this.currentLevelExecutionTrees = currentTree.children;
|
|
2080
|
-
}
|
|
1987
|
+
if (this.verbosity >= VerbosityLevel.Verbose) this.currentLevelExecutionTrees = this.appendExecutionTree(ExecutionStatus.Failure, value).children;
|
|
2081
1988
|
if (this.pathToFailure == null) this.pathToFailure = `${id}`;
|
|
2082
1989
|
else this.pathToFailure += `:${id}`;
|
|
2083
1990
|
this.value = value;
|
|
@@ -2123,9 +2030,8 @@ var RunExecution = class RunExecution {
|
|
|
2123
2030
|
runConfiguration: qParams.toParameters()
|
|
2124
2031
|
};
|
|
2125
2032
|
const considerInterruptedAsFailure = this.interruptedAsFailure || this.numSuccesses === 0;
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
failed,
|
|
2033
|
+
return {
|
|
2034
|
+
failed: this.numSkips > maxSkips || this.interrupted && considerInterruptedAsFailure,
|
|
2129
2035
|
interrupted: this.interrupted,
|
|
2130
2036
|
numRuns: this.numSuccesses,
|
|
2131
2037
|
numSkips: this.numSkips,
|
|
@@ -2140,7 +2046,6 @@ var RunExecution = class RunExecution {
|
|
|
2140
2046
|
verbose: this.verbosity,
|
|
2141
2047
|
runConfiguration: qParams.toParameters()
|
|
2142
2048
|
};
|
|
2143
|
-
return out;
|
|
2144
2049
|
}
|
|
2145
2050
|
};
|
|
2146
2051
|
RunExecution.mergePaths = (offsetPath, path) => {
|
|
@@ -2154,7 +2059,6 @@ RunExecution.mergePaths = (offsetPath, path) => {
|
|
|
2154
2059
|
...remainingItems.slice(1)
|
|
2155
2060
|
].join(":");
|
|
2156
2061
|
};
|
|
2157
|
-
|
|
2158
2062
|
//#endregion
|
|
2159
2063
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/RunnerIterator.js
|
|
2160
2064
|
var RunnerIterator = class {
|
|
@@ -2193,7 +2097,6 @@ var RunnerIterator = class {
|
|
|
2193
2097
|
else this.runExecution.success(this.currentValue.value_);
|
|
2194
2098
|
}
|
|
2195
2099
|
};
|
|
2196
|
-
|
|
2197
2100
|
//#endregion
|
|
2198
2101
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/SourceValuesIterator.js
|
|
2199
2102
|
var SourceValuesIterator = class {
|
|
@@ -2223,7 +2126,6 @@ var SourceValuesIterator = class {
|
|
|
2223
2126
|
++this.maxInitialIterations;
|
|
2224
2127
|
}
|
|
2225
2128
|
};
|
|
2226
|
-
|
|
2227
2129
|
//#endregion
|
|
2228
2130
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/random/generator/Random.js
|
|
2229
2131
|
var Random = class Random {
|
|
@@ -2255,14 +2157,12 @@ var Random = class Random {
|
|
|
2255
2157
|
}
|
|
2256
2158
|
getState() {
|
|
2257
2159
|
if ("getState" in this.internalRng && typeof this.internalRng.getState === "function") return this.internalRng.getState();
|
|
2258
|
-
return void 0;
|
|
2259
2160
|
}
|
|
2260
2161
|
};
|
|
2261
2162
|
Random.MIN_INT = -2147483648;
|
|
2262
2163
|
Random.MAX_INT = 2147483647;
|
|
2263
2164
|
Random.DBL_FACTOR = Math.pow(2, 27);
|
|
2264
2165
|
Random.DBL_DIVISOR = Math.pow(2, -53);
|
|
2265
|
-
|
|
2266
2166
|
//#endregion
|
|
2267
2167
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/Tosser.js
|
|
2268
2168
|
function tossNext(generator, rng, index) {
|
|
@@ -2285,7 +2185,6 @@ function* lazyToss(generator, seed, random, examples) {
|
|
|
2285
2185
|
yield lazyGenerate(generator, rng, idx++);
|
|
2286
2186
|
}
|
|
2287
2187
|
}
|
|
2288
|
-
|
|
2289
2188
|
//#endregion
|
|
2290
2189
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/utils/PathWalker.js
|
|
2291
2190
|
function produce(producer) {
|
|
@@ -2304,7 +2203,6 @@ function pathWalk(path, initialProducers, shrink) {
|
|
|
2304
2203
|
}
|
|
2305
2204
|
return values;
|
|
2306
2205
|
}
|
|
2307
|
-
|
|
2308
2206
|
//#endregion
|
|
2309
2207
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/utils/RunDetailsFormatter.js
|
|
2310
2208
|
const safeObjectAssign$3 = Object.assign;
|
|
@@ -2349,8 +2247,7 @@ function preFormatTooManySkipped(out, stringifyOne) {
|
|
|
2349
2247
|
};
|
|
2350
2248
|
}
|
|
2351
2249
|
function preFormatFailure(out, stringifyOne) {
|
|
2352
|
-
const
|
|
2353
|
-
const messageErrorPart = noErrorInMessage ? "" : `\nGot ${safeReplace(out.error, /^Error: /, "error: ")}`;
|
|
2250
|
+
const messageErrorPart = out.runConfiguration.errorWithCause ? "" : `\nGot ${safeReplace(out.error, /^Error: /, "error: ")}`;
|
|
2354
2251
|
const message = `Property failed after ${out.numRuns} tests\n{ seed: ${out.seed}, path: "${out.counterexamplePath}", endOnFailure: true }\nCounterexample: ${stringifyOne(out.counterexample)}\nShrunk ${out.numShrinks} time(s)${messageErrorPart}`;
|
|
2355
2252
|
let details = null;
|
|
2356
2253
|
const hints = [];
|
|
@@ -2406,8 +2303,7 @@ async function asyncDefaultReportMessage(out) {
|
|
|
2406
2303
|
}
|
|
2407
2304
|
function buildError(errorMessage, out) {
|
|
2408
2305
|
if (!out.runConfiguration.errorWithCause) throw new SError(errorMessage);
|
|
2409
|
-
const
|
|
2410
|
-
const error = new ErrorWithCause(errorMessage, { cause: out.errorInstance });
|
|
2306
|
+
const error = new SError(errorMessage, { cause: out.errorInstance });
|
|
2411
2307
|
if (!("cause" in error)) safeObjectAssign$3(error, { cause: out.errorInstance });
|
|
2412
2308
|
return error;
|
|
2413
2309
|
}
|
|
@@ -2429,28 +2325,27 @@ async function asyncReportRunDetails(out) {
|
|
|
2429
2325
|
else if (out.runConfiguration.reporter) return out.runConfiguration.reporter(out);
|
|
2430
2326
|
else return asyncThrowIfFailed(out);
|
|
2431
2327
|
}
|
|
2432
|
-
|
|
2433
2328
|
//#endregion
|
|
2434
2329
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/Runner.js
|
|
2435
2330
|
const safeObjectAssign$2 = Object.assign;
|
|
2436
|
-
function runIt(property
|
|
2437
|
-
const isModernProperty = property
|
|
2331
|
+
function runIt(property, shrink, sourceValues, verbose, interruptedAsFailure) {
|
|
2332
|
+
const isModernProperty = property.runBeforeEach !== void 0 && property.runAfterEach !== void 0;
|
|
2438
2333
|
const runner = new RunnerIterator(sourceValues, shrink, verbose, interruptedAsFailure);
|
|
2439
2334
|
for (const v of runner) {
|
|
2440
|
-
if (isModernProperty) property
|
|
2441
|
-
const out = property
|
|
2442
|
-
if (isModernProperty) property
|
|
2335
|
+
if (isModernProperty) property.runBeforeEach();
|
|
2336
|
+
const out = property.run(v, isModernProperty);
|
|
2337
|
+
if (isModernProperty) property.runAfterEach();
|
|
2443
2338
|
runner.handleResult(out);
|
|
2444
2339
|
}
|
|
2445
2340
|
return runner.runExecution;
|
|
2446
2341
|
}
|
|
2447
|
-
async function asyncRunIt(property
|
|
2448
|
-
const isModernProperty = property
|
|
2342
|
+
async function asyncRunIt(property, shrink, sourceValues, verbose, interruptedAsFailure) {
|
|
2343
|
+
const isModernProperty = property.runBeforeEach !== void 0 && property.runAfterEach !== void 0;
|
|
2449
2344
|
const runner = new RunnerIterator(sourceValues, shrink, verbose, interruptedAsFailure);
|
|
2450
2345
|
for (const v of runner) {
|
|
2451
|
-
if (isModernProperty) await property
|
|
2452
|
-
const out = await property
|
|
2453
|
-
if (isModernProperty) await property
|
|
2346
|
+
if (isModernProperty) await property.runBeforeEach();
|
|
2347
|
+
const out = await property.run(v, isModernProperty);
|
|
2348
|
+
if (isModernProperty) await property.runAfterEach();
|
|
2454
2349
|
runner.handleResult(out);
|
|
2455
2350
|
}
|
|
2456
2351
|
return runner.runExecution;
|
|
@@ -2461,21 +2356,19 @@ function check(rawProperty, params) {
|
|
|
2461
2356
|
const qParams = QualifiedParameters.read(safeObjectAssign$2(safeObjectAssign$2({}, readConfigureGlobal()), params));
|
|
2462
2357
|
if (qParams.reporter !== null && qParams.asyncReporter !== null) throw new Error("Invalid parameters encountered, reporter and asyncReporter cannot be specified together");
|
|
2463
2358
|
if (qParams.asyncReporter !== null && !rawProperty.isAsync()) throw new Error("Invalid parameters encountered, only asyncProperty can be used when asyncReporter specified");
|
|
2464
|
-
const property
|
|
2359
|
+
const property = decorateProperty(rawProperty, qParams);
|
|
2465
2360
|
const maxInitialIterations = qParams.path.length === 0 || qParams.path.indexOf(":") === -1 ? qParams.numRuns : -1;
|
|
2466
2361
|
const maxSkips = qParams.numRuns * qParams.maxSkipsPerRun;
|
|
2467
|
-
const shrink = (...args) => property
|
|
2468
|
-
const
|
|
2469
|
-
const sourceValues = new SourceValuesIterator(initialValues, maxInitialIterations, maxSkips);
|
|
2362
|
+
const shrink = (...args) => property.shrink(...args);
|
|
2363
|
+
const sourceValues = new SourceValuesIterator(qParams.path.length === 0 ? toss(property, qParams.seed, qParams.randomType, qParams.examples) : pathWalk(qParams.path, stream(lazyToss(property, qParams.seed, qParams.randomType, qParams.examples)), shrink), maxInitialIterations, maxSkips);
|
|
2470
2364
|
const finalShrink = !qParams.endOnFailure ? shrink : Stream.nil;
|
|
2471
|
-
return property
|
|
2365
|
+
return property.isAsync() ? asyncRunIt(property, finalShrink, sourceValues, qParams.verbose, qParams.markInterruptAsFailure).then((e) => e.toRunDetails(qParams.seed, qParams.path, maxSkips, qParams)) : runIt(property, finalShrink, sourceValues, qParams.verbose, qParams.markInterruptAsFailure).toRunDetails(qParams.seed, qParams.path, maxSkips, qParams);
|
|
2472
2366
|
}
|
|
2473
|
-
function assert(property
|
|
2474
|
-
const out = check(property
|
|
2475
|
-
if (property
|
|
2367
|
+
function assert(property, params) {
|
|
2368
|
+
const out = check(property, params);
|
|
2369
|
+
if (property.isAsync()) return out.then(asyncReportRunDetails);
|
|
2476
2370
|
else reportRunDetails(out);
|
|
2477
2371
|
}
|
|
2478
|
-
|
|
2479
2372
|
//#endregion
|
|
2480
2373
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BiasNumericRange.js
|
|
2481
2374
|
const safeMathFloor$4 = Math.floor;
|
|
@@ -2484,8 +2377,8 @@ function integerLogLike(v) {
|
|
|
2484
2377
|
return safeMathFloor$4(safeMathLog$1(v) / safeMathLog$1(2));
|
|
2485
2378
|
}
|
|
2486
2379
|
function bigIntLogLike(v) {
|
|
2487
|
-
if (v === SBigInt(0)) return SBigInt(0);
|
|
2488
|
-
return SBigInt(SString(v).length);
|
|
2380
|
+
if (v === SBigInt$1(0)) return SBigInt$1(0);
|
|
2381
|
+
return SBigInt$1(SString(v).length);
|
|
2489
2382
|
}
|
|
2490
2383
|
function biasNumericRange(min, max, logLike) {
|
|
2491
2384
|
if (min === max) return [{
|
|
@@ -2521,7 +2414,6 @@ function biasNumericRange(min, max, logLike) {
|
|
|
2521
2414
|
};
|
|
2522
2415
|
return min < 0 ? [arbCloseToMax, arbCloseToMin] : [arbCloseToMin, arbCloseToMax];
|
|
2523
2416
|
}
|
|
2524
|
-
|
|
2525
2417
|
//#endregion
|
|
2526
2418
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkInteger.js
|
|
2527
2419
|
const safeMathCeil = Math.ceil;
|
|
@@ -2554,7 +2446,6 @@ function shrinkInteger(current, target, tryTargetAsap) {
|
|
|
2554
2446
|
}
|
|
2555
2447
|
return realGap > 0 ? stream(shrinkDecr()) : stream(shrinkIncr());
|
|
2556
2448
|
}
|
|
2557
|
-
|
|
2558
2449
|
//#endregion
|
|
2559
2450
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/IntegerArbitrary.js
|
|
2560
2451
|
const safeMathSign = Math.sign;
|
|
@@ -2574,10 +2465,7 @@ var IntegerArbitrary = class IntegerArbitrary extends Arbitrary {
|
|
|
2574
2465
|
return typeof value === "number" && safeNumberIsInteger$6(value) && !safeObjectIs$4(value, -0) && this.min <= value && value <= this.max;
|
|
2575
2466
|
}
|
|
2576
2467
|
shrink(current, context) {
|
|
2577
|
-
if (!IntegerArbitrary.isValidContext(current, context))
|
|
2578
|
-
const target = this.defaultTarget();
|
|
2579
|
-
return shrinkInteger(current, target, true);
|
|
2580
|
-
}
|
|
2468
|
+
if (!IntegerArbitrary.isValidContext(current, context)) return shrinkInteger(current, this.defaultTarget(), true);
|
|
2581
2469
|
if (this.isLastChanceTry(current, context)) return Stream.of(new Value(context, void 0));
|
|
2582
2470
|
return shrinkInteger(current, context, false);
|
|
2583
2471
|
}
|
|
@@ -2607,16 +2495,13 @@ var IntegerArbitrary = class IntegerArbitrary extends Arbitrary {
|
|
|
2607
2495
|
return true;
|
|
2608
2496
|
}
|
|
2609
2497
|
};
|
|
2610
|
-
|
|
2611
2498
|
//#endregion
|
|
2612
2499
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/integer.js
|
|
2613
2500
|
const safeNumberIsInteger$5 = Number.isInteger;
|
|
2614
2501
|
function buildCompleteIntegerConstraints(constraints) {
|
|
2615
|
-
const min = constraints.min !== void 0 ? constraints.min : -2147483648;
|
|
2616
|
-
const max = constraints.max !== void 0 ? constraints.max : 2147483647;
|
|
2617
2502
|
return {
|
|
2618
|
-
min,
|
|
2619
|
-
max
|
|
2503
|
+
min: constraints.min !== void 0 ? constraints.min : -2147483648,
|
|
2504
|
+
max: constraints.max !== void 0 ? constraints.max : 2147483647
|
|
2620
2505
|
};
|
|
2621
2506
|
}
|
|
2622
2507
|
function integer(constraints = {}) {
|
|
@@ -2626,7 +2511,6 @@ function integer(constraints = {}) {
|
|
|
2626
2511
|
if (!safeNumberIsInteger$5(fullConstraints.max)) throw new Error("fc.integer maximum value should be an integer");
|
|
2627
2512
|
return new IntegerArbitrary(fullConstraints.min, fullConstraints.max);
|
|
2628
2513
|
}
|
|
2629
|
-
|
|
2630
2514
|
//#endregion
|
|
2631
2515
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DepthContext.js
|
|
2632
2516
|
const depthContextCache = /* @__PURE__ */ new Map();
|
|
@@ -2640,10 +2524,8 @@ function getDepthContextFor(contextMeta) {
|
|
|
2640
2524
|
return context;
|
|
2641
2525
|
}
|
|
2642
2526
|
function createDepthIdentifier() {
|
|
2643
|
-
|
|
2644
|
-
return identifier;
|
|
2527
|
+
return { depth: 0 };
|
|
2645
2528
|
}
|
|
2646
|
-
|
|
2647
2529
|
//#endregion
|
|
2648
2530
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/NoopSlicedGenerator.js
|
|
2649
2531
|
var NoopSlicedGenerator = class {
|
|
@@ -2652,14 +2534,11 @@ var NoopSlicedGenerator = class {
|
|
|
2652
2534
|
this.mrng = mrng;
|
|
2653
2535
|
this.biasFactor = biasFactor;
|
|
2654
2536
|
}
|
|
2655
|
-
attemptExact() {
|
|
2656
|
-
return;
|
|
2657
|
-
}
|
|
2537
|
+
attemptExact() {}
|
|
2658
2538
|
next() {
|
|
2659
2539
|
return this.arb.generate(this.mrng, this.biasFactor);
|
|
2660
2540
|
}
|
|
2661
2541
|
};
|
|
2662
|
-
|
|
2663
2542
|
//#endregion
|
|
2664
2543
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/SlicedBasedGenerator.js
|
|
2665
2544
|
const safeMathMin$4 = Math.min;
|
|
@@ -2677,10 +2556,7 @@ var SlicedBasedGenerator = class {
|
|
|
2677
2556
|
attemptExact(targetLength) {
|
|
2678
2557
|
if (targetLength !== 0 && this.mrng.nextInt(1, this.biasFactor) === 1) {
|
|
2679
2558
|
const eligibleIndices = [];
|
|
2680
|
-
for (let index = 0; index !== this.slices.length; ++index)
|
|
2681
|
-
const slice = this.slices[index];
|
|
2682
|
-
if (slice.length === targetLength) safePush(eligibleIndices, index);
|
|
2683
|
-
}
|
|
2559
|
+
for (let index = 0; index !== this.slices.length; ++index) if (this.slices[index].length === targetLength) safePush(eligibleIndices, index);
|
|
2684
2560
|
if (eligibleIndices.length === 0) return;
|
|
2685
2561
|
this.activeSliceIndex = eligibleIndices[this.mrng.nextInt(0, eligibleIndices.length - 1)];
|
|
2686
2562
|
this.nextIndexInSlice = 0;
|
|
@@ -2704,14 +2580,12 @@ var SlicedBasedGenerator = class {
|
|
|
2704
2580
|
return new Value(slice[this.nextIndexInSlice++], void 0);
|
|
2705
2581
|
}
|
|
2706
2582
|
};
|
|
2707
|
-
|
|
2708
2583
|
//#endregion
|
|
2709
2584
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BuildSlicedGenerator.js
|
|
2710
2585
|
function buildSlicedGenerator(arb, mrng, slices, biasFactor) {
|
|
2711
2586
|
if (biasFactor === void 0 || slices.length === 0 || mrng.nextInt(1, biasFactor) !== 1) return new NoopSlicedGenerator(arb, mrng, biasFactor);
|
|
2712
2587
|
return new SlicedBasedGenerator(arb, mrng, slices, biasFactor);
|
|
2713
2588
|
}
|
|
2714
|
-
|
|
2715
2589
|
//#endregion
|
|
2716
2590
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ArrayArbitrary.js
|
|
2717
2591
|
const safeMathFloor$2 = Math.floor;
|
|
@@ -2776,10 +2650,7 @@ var ArrayArbitrary = class ArrayArbitrary extends Arbitrary {
|
|
|
2776
2650
|
const items = [];
|
|
2777
2651
|
const slicedGenerator = buildSlicedGenerator(this.arb, mrng, this.customSlices, biasFactorItems);
|
|
2778
2652
|
slicedGenerator.attemptExact(N);
|
|
2779
|
-
for (let index = 0; index !== N; ++index)
|
|
2780
|
-
const current = slicedGenerator.next();
|
|
2781
|
-
safePush(items, current);
|
|
2782
|
-
}
|
|
2653
|
+
for (let index = 0; index !== N; ++index) safePush(items, slicedGenerator.next());
|
|
2783
2654
|
return items;
|
|
2784
2655
|
}
|
|
2785
2656
|
safeGenerateNItems(N, mrng, biasFactorItems) {
|
|
@@ -2803,13 +2674,12 @@ var ArrayArbitrary = class ArrayArbitrary extends Arbitrary {
|
|
|
2803
2674
|
safePush(itemsContexts, s.context);
|
|
2804
2675
|
}
|
|
2805
2676
|
if (cloneable) ArrayArbitrary.makeItCloneable(vs, items);
|
|
2806
|
-
|
|
2677
|
+
return new Value(vs, {
|
|
2807
2678
|
shrunkOnce,
|
|
2808
2679
|
lengthContext: itemsRaw.length === items.length && itemsRawLengthContext !== void 0 ? itemsRawLengthContext : void 0,
|
|
2809
2680
|
itemsContexts,
|
|
2810
2681
|
startIndex
|
|
2811
|
-
};
|
|
2812
|
-
return new Value(vs, context);
|
|
2682
|
+
});
|
|
2813
2683
|
}
|
|
2814
2684
|
generate(mrng, biasFactor) {
|
|
2815
2685
|
const biasMeta = this.applyBias(mrng, biasFactor);
|
|
@@ -2829,12 +2699,11 @@ var ArrayArbitrary = class ArrayArbitrary extends Arbitrary {
|
|
|
2829
2699
|
biasFactorItems: biasFactor
|
|
2830
2700
|
};
|
|
2831
2701
|
const maxBiasedLength = biasedMaxLength(this.minLength, this.maxGeneratedLength);
|
|
2832
|
-
const targetSizeValue = integer({
|
|
2833
|
-
min: this.minLength,
|
|
2834
|
-
max: maxBiasedLength
|
|
2835
|
-
}).generate(mrng, void 0);
|
|
2836
2702
|
return {
|
|
2837
|
-
size:
|
|
2703
|
+
size: integer({
|
|
2704
|
+
min: this.minLength,
|
|
2705
|
+
max: maxBiasedLength
|
|
2706
|
+
}).generate(mrng, void 0).value,
|
|
2838
2707
|
biasFactorItems: biasFactor
|
|
2839
2708
|
};
|
|
2840
2709
|
}
|
|
@@ -2844,14 +2713,13 @@ var ArrayArbitrary = class ArrayArbitrary extends Arbitrary {
|
|
|
2844
2713
|
if (!(index in value)) return false;
|
|
2845
2714
|
if (!this.arb.canShrinkWithoutContext(value[index])) return false;
|
|
2846
2715
|
}
|
|
2847
|
-
|
|
2848
|
-
return filtered.length === value.length;
|
|
2716
|
+
return this.preFilter(safeMap(value, (item) => new Value(item, void 0))).length === value.length;
|
|
2849
2717
|
}
|
|
2850
2718
|
shrinkItemByItem(value, safeContext, endIndex) {
|
|
2851
2719
|
const shrinks = [];
|
|
2852
2720
|
for (let index = safeContext.startIndex; index < endIndex; ++index) safePush(shrinks, makeLazy(() => this.arb.shrink(value[index], safeContext.itemsContexts[index]).map((v) => {
|
|
2853
|
-
const beforeCurrent = safeMap(safeSlice(value, 0, index), (v
|
|
2854
|
-
const afterCurrent = safeMap(safeSlice(value, index + 1), (v
|
|
2721
|
+
const beforeCurrent = safeMap(safeSlice(value, 0, index), (v, i) => new Value(cloneIfNeeded(v), safeContext.itemsContexts[i]));
|
|
2722
|
+
const afterCurrent = safeMap(safeSlice(value, index + 1), (v, i) => new Value(cloneIfNeeded(v), safeContext.itemsContexts[i + index + 1]));
|
|
2855
2723
|
return [
|
|
2856
2724
|
[
|
|
2857
2725
|
...beforeCurrent,
|
|
@@ -2899,7 +2767,6 @@ var ArrayArbitrary = class ArrayArbitrary extends Arbitrary {
|
|
|
2899
2767
|
return this.shrinkImpl(value, context).map((contextualValue) => this.wrapper(contextualValue[0], true, contextualValue[1], contextualValue[2]));
|
|
2900
2768
|
}
|
|
2901
2769
|
};
|
|
2902
|
-
|
|
2903
2770
|
//#endregion
|
|
2904
2771
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/MaxLengthFromMinLength.js
|
|
2905
2772
|
const safeMathFloor$1 = Math.floor;
|
|
@@ -2946,16 +2813,14 @@ function maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, spec
|
|
|
2946
2813
|
const { baseSize: defaultSize = DefaultSize, defaultSizeToMaxWhenMaxSpecified } = readConfigureGlobal() || {};
|
|
2947
2814
|
const definedSize = size !== void 0 ? size : specifiedMaxLength && defaultSizeToMaxWhenMaxSpecified ? "max" : defaultSize;
|
|
2948
2815
|
if (definedSize === "max") return maxLength;
|
|
2949
|
-
|
|
2950
|
-
return safeMathMin$3(maxLengthFromMinLength(minLength, finalSize), maxLength);
|
|
2816
|
+
return safeMathMin$3(maxLengthFromMinLength(minLength, relativeSizeToSize(definedSize, defaultSize)), maxLength);
|
|
2951
2817
|
}
|
|
2952
2818
|
function depthBiasFromSizeForArbitrary(depthSizeOrSize, specifiedMaxDepth) {
|
|
2953
2819
|
if (typeof depthSizeOrSize === "number") return 1 / depthSizeOrSize;
|
|
2954
2820
|
const { baseSize: defaultSize = DefaultSize, defaultSizeToMaxWhenMaxSpecified } = readConfigureGlobal() || {};
|
|
2955
2821
|
const definedSize = depthSizeOrSize !== void 0 ? depthSizeOrSize : specifiedMaxDepth && defaultSizeToMaxWhenMaxSpecified ? "max" : defaultSize;
|
|
2956
2822
|
if (definedSize === "max") return 0;
|
|
2957
|
-
|
|
2958
|
-
switch (finalSize) {
|
|
2823
|
+
switch (relativeSizeToSize(definedSize, defaultSize)) {
|
|
2959
2824
|
case "xsmall": return 1;
|
|
2960
2825
|
case "small": return .5;
|
|
2961
2826
|
case "medium": return .25;
|
|
@@ -2963,7 +2828,6 @@ function depthBiasFromSizeForArbitrary(depthSizeOrSize, specifiedMaxDepth) {
|
|
|
2963
2828
|
case "xlarge": return .0625;
|
|
2964
2829
|
}
|
|
2965
2830
|
}
|
|
2966
|
-
|
|
2967
2831
|
//#endregion
|
|
2968
2832
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/array.js
|
|
2969
2833
|
function array(arb, constraints = {}) {
|
|
@@ -2972,16 +2836,12 @@ function array(arb, constraints = {}) {
|
|
|
2972
2836
|
const maxLengthOrUnset = constraints.maxLength;
|
|
2973
2837
|
const depthIdentifier = constraints.depthIdentifier;
|
|
2974
2838
|
const maxLength = maxLengthOrUnset !== void 0 ? maxLengthOrUnset : MaxLengthUpperBound;
|
|
2975
|
-
|
|
2976
|
-
const maxGeneratedLength = maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, specifiedMaxLength);
|
|
2977
|
-
const customSlices = constraints.experimentalCustomSlices || [];
|
|
2978
|
-
return new ArrayArbitrary(arb, minLength, maxGeneratedLength, maxLength, depthIdentifier, void 0, customSlices);
|
|
2839
|
+
return new ArrayArbitrary(arb, minLength, maxGeneratedLengthFromSizeForArbitrary(size, minLength, maxLength, maxLengthOrUnset !== void 0), maxLength, depthIdentifier, void 0, constraints.experimentalCustomSlices || []);
|
|
2979
2840
|
}
|
|
2980
|
-
|
|
2981
2841
|
//#endregion
|
|
2982
2842
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkBigInt.js
|
|
2983
2843
|
function halveBigInt(n) {
|
|
2984
|
-
return n / SBigInt(2);
|
|
2844
|
+
return n / SBigInt$1(2);
|
|
2985
2845
|
}
|
|
2986
2846
|
function shrinkBigInt(current, target, tryTargetAsap) {
|
|
2987
2847
|
const realGap = current - target;
|
|
@@ -3005,7 +2865,6 @@ function shrinkBigInt(current, target, tryTargetAsap) {
|
|
|
3005
2865
|
}
|
|
3006
2866
|
return realGap > 0 ? stream(shrinkDecr()) : stream(shrinkIncr());
|
|
3007
2867
|
}
|
|
3008
|
-
|
|
3009
2868
|
//#endregion
|
|
3010
2869
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/BigIntArbitrary.js
|
|
3011
2870
|
var BigIntArbitrary = class BigIntArbitrary extends Arbitrary {
|
|
@@ -3032,50 +2891,43 @@ var BigIntArbitrary = class BigIntArbitrary extends Arbitrary {
|
|
|
3032
2891
|
return typeof value === "bigint" && this.min <= value && value <= this.max;
|
|
3033
2892
|
}
|
|
3034
2893
|
shrink(current, context) {
|
|
3035
|
-
if (!BigIntArbitrary.isValidContext(current, context))
|
|
3036
|
-
const target = this.defaultTarget();
|
|
3037
|
-
return shrinkBigInt(current, target, true);
|
|
3038
|
-
}
|
|
2894
|
+
if (!BigIntArbitrary.isValidContext(current, context)) return shrinkBigInt(current, this.defaultTarget(), true);
|
|
3039
2895
|
if (this.isLastChanceTry(current, context)) return Stream.of(new Value(context, void 0));
|
|
3040
2896
|
return shrinkBigInt(current, context, false);
|
|
3041
2897
|
}
|
|
3042
2898
|
defaultTarget() {
|
|
3043
|
-
if (this.min <= 0 && this.max >= 0) return SBigInt(0);
|
|
2899
|
+
if (this.min <= 0 && this.max >= 0) return SBigInt$1(0);
|
|
3044
2900
|
return this.min < 0 ? this.max : this.min;
|
|
3045
2901
|
}
|
|
3046
2902
|
isLastChanceTry(current, context) {
|
|
3047
|
-
if (current > 0) return current === context + SBigInt(1) && current > this.min;
|
|
3048
|
-
if (current < 0) return current === context - SBigInt(1) && current < this.max;
|
|
2903
|
+
if (current > 0) return current === context + SBigInt$1(1) && current > this.min;
|
|
2904
|
+
if (current < 0) return current === context - SBigInt$1(1) && current < this.max;
|
|
3049
2905
|
return false;
|
|
3050
2906
|
}
|
|
3051
2907
|
static isValidContext(current, context) {
|
|
3052
2908
|
if (context === void 0) return false;
|
|
3053
2909
|
if (typeof context !== "bigint") throw new Error(`Invalid context type passed to BigIntArbitrary (#1)`);
|
|
3054
2910
|
const differentSigns = current > 0 && context < 0 || current < 0 && context > 0;
|
|
3055
|
-
if (context !== SBigInt(0) && differentSigns) throw new Error(`Invalid context value passed to BigIntArbitrary (#2)`);
|
|
2911
|
+
if (context !== SBigInt$1(0) && differentSigns) throw new Error(`Invalid context value passed to BigIntArbitrary (#2)`);
|
|
3056
2912
|
return true;
|
|
3057
2913
|
}
|
|
3058
2914
|
};
|
|
3059
|
-
|
|
3060
2915
|
//#endregion
|
|
3061
2916
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/bigInt.js
|
|
3062
2917
|
function buildCompleteBigIntConstraints(constraints) {
|
|
3063
2918
|
const DefaultPow = 256;
|
|
3064
|
-
const DefaultMin = SBigInt(-1) << SBigInt(DefaultPow - 1);
|
|
3065
|
-
const DefaultMax = (SBigInt(1) << SBigInt(DefaultPow - 1)) - SBigInt(1);
|
|
2919
|
+
const DefaultMin = SBigInt$1(-1) << SBigInt$1(DefaultPow - 1);
|
|
2920
|
+
const DefaultMax = (SBigInt$1(1) << SBigInt$1(DefaultPow - 1)) - SBigInt$1(1);
|
|
3066
2921
|
const min = constraints.min;
|
|
3067
2922
|
const max = constraints.max;
|
|
3068
2923
|
return {
|
|
3069
|
-
min: min !== void 0 ? min : DefaultMin - (max !== void 0 && max < SBigInt(0) ? max * max : SBigInt(0)),
|
|
3070
|
-
max: max !== void 0 ? max : DefaultMax + (min !== void 0 && min > SBigInt(0) ? min * min : SBigInt(0))
|
|
2924
|
+
min: min !== void 0 ? min : DefaultMin - (max !== void 0 && max < SBigInt$1(0) ? max * max : SBigInt$1(0)),
|
|
2925
|
+
max: max !== void 0 ? max : DefaultMax + (min !== void 0 && min > SBigInt$1(0) ? min * min : SBigInt$1(0))
|
|
3071
2926
|
};
|
|
3072
2927
|
}
|
|
3073
2928
|
function extractBigIntConstraints(args) {
|
|
3074
2929
|
if (args[0] === void 0) return {};
|
|
3075
|
-
if (args[1] === void 0)
|
|
3076
|
-
const constraints = args[0];
|
|
3077
|
-
return constraints;
|
|
3078
|
-
}
|
|
2930
|
+
if (args[1] === void 0) return args[0];
|
|
3079
2931
|
return {
|
|
3080
2932
|
min: args[0],
|
|
3081
2933
|
max: args[1]
|
|
@@ -3086,13 +2938,11 @@ function bigInt(...args) {
|
|
|
3086
2938
|
if (constraints.min > constraints.max) throw new Error("fc.bigInt expects max to be greater than or equal to min");
|
|
3087
2939
|
return new BigIntArbitrary(constraints.min, constraints.max);
|
|
3088
2940
|
}
|
|
3089
|
-
|
|
3090
2941
|
//#endregion
|
|
3091
2942
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/noBias.js
|
|
3092
2943
|
function noBias(arb) {
|
|
3093
2944
|
return arb.noBias();
|
|
3094
2945
|
}
|
|
3095
|
-
|
|
3096
2946
|
//#endregion
|
|
3097
2947
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/boolean.js
|
|
3098
2948
|
function booleanMapper(v) {
|
|
@@ -3108,7 +2958,6 @@ function boolean() {
|
|
|
3108
2958
|
max: 1
|
|
3109
2959
|
}).map(booleanMapper, booleanUnmapper));
|
|
3110
2960
|
}
|
|
3111
|
-
|
|
3112
2961
|
//#endregion
|
|
3113
2962
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ConstantArbitrary.js
|
|
3114
2963
|
const safeObjectIs$3 = Object.is;
|
|
@@ -3155,14 +3004,12 @@ var FastConstantValuesLookup = class {
|
|
|
3155
3004
|
return safeHas(this.fastValues, value);
|
|
3156
3005
|
}
|
|
3157
3006
|
};
|
|
3158
|
-
|
|
3159
3007
|
//#endregion
|
|
3160
3008
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/constantFrom.js
|
|
3161
3009
|
function constantFrom(...values) {
|
|
3162
3010
|
if (values.length === 0) throw new Error("fc.constantFrom expects at least one parameter");
|
|
3163
3011
|
return new ConstantArbitrary(values);
|
|
3164
3012
|
}
|
|
3165
|
-
|
|
3166
3013
|
//#endregion
|
|
3167
3014
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToCharString.js
|
|
3168
3015
|
const indexToCharStringMapper = String.fromCodePoint;
|
|
@@ -3175,7 +3022,6 @@ function indexToCharStringUnmapper(c) {
|
|
|
3175
3022
|
if (c1 < 55296 || c1 > 56319 || c2 < 56320 || c2 > 57343) throw new Error("Cannot unmap invalid surrogate pairs");
|
|
3176
3023
|
return c.codePointAt(0);
|
|
3177
3024
|
}
|
|
3178
|
-
|
|
3179
3025
|
//#endregion
|
|
3180
3026
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/CharacterArbitraryBuilder.js
|
|
3181
3027
|
function buildCharacterArbitrary(min, max, mapToCode, unmapFromCode) {
|
|
@@ -3184,7 +3030,6 @@ function buildCharacterArbitrary(min, max, mapToCode, unmapFromCode) {
|
|
|
3184
3030
|
max
|
|
3185
3031
|
}).map((n) => indexToCharStringMapper(mapToCode(n)), (c) => unmapFromCode(indexToCharStringUnmapper(c)));
|
|
3186
3032
|
}
|
|
3187
|
-
|
|
3188
3033
|
//#endregion
|
|
3189
3034
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToPrintableIndex.js
|
|
3190
3035
|
function indexToPrintableIndexMapper(v) {
|
|
@@ -3197,7 +3042,6 @@ function indexToPrintableIndexUnmapper(v) {
|
|
|
3197
3042
|
if (v >= 0 && v <= 31) return v + 95;
|
|
3198
3043
|
return v;
|
|
3199
3044
|
}
|
|
3200
|
-
|
|
3201
3045
|
//#endregion
|
|
3202
3046
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/fullUnicode.js
|
|
3203
3047
|
const gapSize = 2048;
|
|
@@ -3213,13 +3057,11 @@ function unicodeUnmapper(v) {
|
|
|
3213
3057
|
function fullUnicode() {
|
|
3214
3058
|
return buildCharacterArbitrary(0, 1114111 - gapSize, unicodeMapper, unicodeUnmapper);
|
|
3215
3059
|
}
|
|
3216
|
-
|
|
3217
3060
|
//#endregion
|
|
3218
3061
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/constant.js
|
|
3219
3062
|
function constant(value) {
|
|
3220
3063
|
return new ConstantArbitrary([value]);
|
|
3221
3064
|
}
|
|
3222
|
-
|
|
3223
3065
|
//#endregion
|
|
3224
3066
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/TimeToDate.js
|
|
3225
3067
|
const safeNaN$2 = NaN;
|
|
@@ -3242,7 +3084,6 @@ function timeToDateUnmapperWithNaN(valueForNaN) {
|
|
|
3242
3084
|
return safeNumberIsNaN$4(time) ? valueForNaN : time;
|
|
3243
3085
|
};
|
|
3244
3086
|
}
|
|
3245
|
-
|
|
3246
3087
|
//#endregion
|
|
3247
3088
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/date.js
|
|
3248
3089
|
const safeNumberIsNaN$3 = Number.isNaN;
|
|
@@ -3263,7 +3104,6 @@ function date(constraints = {}) {
|
|
|
3263
3104
|
max: intMax + 1
|
|
3264
3105
|
}).map(timeToDateMapperWithNaN(valueForNaN), timeToDateUnmapperWithNaN(valueForNaN));
|
|
3265
3106
|
}
|
|
3266
|
-
|
|
3267
3107
|
//#endregion
|
|
3268
3108
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/CustomEqualSet.js
|
|
3269
3109
|
var CustomEqualSet = class {
|
|
@@ -3283,7 +3123,6 @@ var CustomEqualSet = class {
|
|
|
3283
3123
|
return this.data;
|
|
3284
3124
|
}
|
|
3285
3125
|
};
|
|
3286
|
-
|
|
3287
3126
|
//#endregion
|
|
3288
3127
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/StrictlyEqualSet.js
|
|
3289
3128
|
const safeNumberIsNaN$2 = Number.isNaN;
|
|
@@ -3314,7 +3153,6 @@ var StrictlyEqualSet = class {
|
|
|
3314
3153
|
return this.data;
|
|
3315
3154
|
}
|
|
3316
3155
|
};
|
|
3317
|
-
|
|
3318
3156
|
//#endregion
|
|
3319
3157
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SameValueSet.js
|
|
3320
3158
|
const safeObjectIs$2 = Object.is;
|
|
@@ -3348,7 +3186,6 @@ var SameValueSet = class {
|
|
|
3348
3186
|
return this.data;
|
|
3349
3187
|
}
|
|
3350
3188
|
};
|
|
3351
|
-
|
|
3352
3189
|
//#endregion
|
|
3353
3190
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SameValueZeroSet.js
|
|
3354
3191
|
var SameValueZeroSet = class {
|
|
@@ -3374,20 +3211,19 @@ var SameValueZeroSet = class {
|
|
|
3374
3211
|
return this.data;
|
|
3375
3212
|
}
|
|
3376
3213
|
};
|
|
3377
|
-
|
|
3378
3214
|
//#endregion
|
|
3379
3215
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uniqueArray.js
|
|
3380
3216
|
function buildUniqueArraySetBuilder(constraints) {
|
|
3381
3217
|
if (typeof constraints.comparator === "function") {
|
|
3382
3218
|
if (constraints.selector === void 0) {
|
|
3383
|
-
const comparator
|
|
3384
|
-
const isEqualForBuilder
|
|
3385
|
-
return () => new CustomEqualSet(isEqualForBuilder
|
|
3219
|
+
const comparator = constraints.comparator;
|
|
3220
|
+
const isEqualForBuilder = (nextA, nextB) => comparator(nextA.value_, nextB.value_);
|
|
3221
|
+
return () => new CustomEqualSet(isEqualForBuilder);
|
|
3386
3222
|
}
|
|
3387
3223
|
const comparator = constraints.comparator;
|
|
3388
|
-
const selector
|
|
3389
|
-
const refinedSelector
|
|
3390
|
-
const isEqualForBuilder = (nextA, nextB) => comparator(refinedSelector
|
|
3224
|
+
const selector = constraints.selector;
|
|
3225
|
+
const refinedSelector = (next) => selector(next.value_);
|
|
3226
|
+
const isEqualForBuilder = (nextA, nextB) => comparator(refinedSelector(nextA), refinedSelector(nextB));
|
|
3391
3227
|
return () => new CustomEqualSet(isEqualForBuilder);
|
|
3392
3228
|
}
|
|
3393
3229
|
const selector = constraints.selector || ((v) => v);
|
|
@@ -3404,12 +3240,10 @@ function uniqueArray(arb, constraints = {}) {
|
|
|
3404
3240
|
const maxLength = constraints.maxLength !== void 0 ? constraints.maxLength : MaxLengthUpperBound;
|
|
3405
3241
|
const maxGeneratedLength = maxGeneratedLengthFromSizeForArbitrary(constraints.size, minLength, maxLength, constraints.maxLength !== void 0);
|
|
3406
3242
|
const depthIdentifier = constraints.depthIdentifier;
|
|
3407
|
-
const
|
|
3408
|
-
const arrayArb = new ArrayArbitrary(arb, minLength, maxGeneratedLength, maxLength, depthIdentifier, setBuilder, []);
|
|
3243
|
+
const arrayArb = new ArrayArbitrary(arb, minLength, maxGeneratedLength, maxLength, depthIdentifier, buildUniqueArraySetBuilder(constraints), []);
|
|
3409
3244
|
if (minLength === 0) return arrayArb;
|
|
3410
3245
|
return arrayArb.filter((tab) => tab.length >= minLength);
|
|
3411
3246
|
}
|
|
3412
|
-
|
|
3413
3247
|
//#endregion
|
|
3414
3248
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/KeyValuePairsToObject.js
|
|
3415
3249
|
const safeObjectCreate$1 = Object.create;
|
|
@@ -3444,7 +3278,6 @@ function keyValuePairsToObjectUnmapper(value) {
|
|
|
3444
3278
|
if (!safeEvery(safeObjectGetOwnPropertyNames(value), buildIsValidPropertyNameFilter(value))) throw new SError("Incompatible instance received: should contain only c/e/w properties without get/set");
|
|
3445
3279
|
return [safeObjectEntries$1(value), hasNullPrototype];
|
|
3446
3280
|
}
|
|
3447
|
-
|
|
3448
3281
|
//#endregion
|
|
3449
3282
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/dictionary.js
|
|
3450
3283
|
function dictionaryKeyExtractor(entry) {
|
|
@@ -3460,7 +3293,6 @@ function dictionary(keyArb, valueArb, constraints = {}) {
|
|
|
3460
3293
|
depthIdentifier: constraints.depthIdentifier
|
|
3461
3294
|
}), noNullPrototype ? constant(false) : boolean()).map(keyValuePairsToObjectMapper, keyValuePairsToObjectUnmapper);
|
|
3462
3295
|
}
|
|
3463
|
-
|
|
3464
3296
|
//#endregion
|
|
3465
3297
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/FrequencyArbitrary.js
|
|
3466
3298
|
const safePositiveInfinity$7 = Number.POSITIVE_INFINITY;
|
|
@@ -3474,20 +3306,18 @@ var FrequencyArbitrary = class FrequencyArbitrary extends Arbitrary {
|
|
|
3474
3306
|
if (warbs.length === 0) throw new Error(`${label} expects at least one weighted arbitrary`);
|
|
3475
3307
|
let totalWeight = 0;
|
|
3476
3308
|
for (let idx = 0; idx !== warbs.length; ++idx) {
|
|
3477
|
-
|
|
3478
|
-
if (currentArbitrary === void 0) throw new Error(`${label} expects arbitraries to be specified`);
|
|
3309
|
+
if (warbs[idx].arbitrary === void 0) throw new Error(`${label} expects arbitraries to be specified`);
|
|
3479
3310
|
const currentWeight = warbs[idx].weight;
|
|
3480
3311
|
totalWeight += currentWeight;
|
|
3481
3312
|
if (!safeNumberIsInteger$4(currentWeight)) throw new Error(`${label} expects weights to be integer values`);
|
|
3482
3313
|
if (currentWeight < 0) throw new Error(`${label} expects weights to be superior or equal to 0`);
|
|
3483
3314
|
}
|
|
3484
3315
|
if (totalWeight <= 0) throw new Error(`${label} expects the sum of weights to be strictly superior to 0`);
|
|
3485
|
-
|
|
3316
|
+
return new FrequencyArbitrary(warbs, {
|
|
3486
3317
|
depthBias: depthBiasFromSizeForArbitrary(constraints.depthSize, constraints.maxDepth !== void 0),
|
|
3487
3318
|
maxDepth: constraints.maxDepth != void 0 ? constraints.maxDepth : safePositiveInfinity$7,
|
|
3488
3319
|
withCrossShrink: !!constraints.withCrossShrink
|
|
3489
|
-
};
|
|
3490
|
-
return new FrequencyArbitrary(warbs, sanitizedConstraints, getDepthContextFor(constraints.depthIdentifier));
|
|
3320
|
+
}, getDepthContextFor(constraints.depthIdentifier));
|
|
3491
3321
|
}
|
|
3492
3322
|
constructor(warbs, constraints, context) {
|
|
3493
3323
|
super();
|
|
@@ -3516,8 +3346,7 @@ var FrequencyArbitrary = class FrequencyArbitrary extends Arbitrary {
|
|
|
3516
3346
|
const safeContext = context;
|
|
3517
3347
|
const selectedIndex = safeContext.selectedIndex;
|
|
3518
3348
|
const originalBias = safeContext.originalBias;
|
|
3519
|
-
const
|
|
3520
|
-
const originalShrinks = originalArbitrary.shrink(value, safeContext.originalContext).map((v) => this.mapIntoValue(selectedIndex, v, null, originalBias));
|
|
3349
|
+
const originalShrinks = this.warbs[selectedIndex].arbitrary.shrink(value, safeContext.originalContext).map((v) => this.mapIntoValue(selectedIndex, v, null, originalBias));
|
|
3521
3350
|
if (safeContext.clonedMrngForFallbackFirst !== null) {
|
|
3522
3351
|
if (safeContext.cachedGeneratedForFirst === void 0) safeContext.cachedGeneratedForFirst = this.safeGenerateForIndex(safeContext.clonedMrngForFallbackFirst, 0, originalBias);
|
|
3523
3352
|
const valueFromFirst = safeContext.cachedGeneratedForFirst;
|
|
@@ -3584,7 +3413,6 @@ var FrequencyArbitrary = class FrequencyArbitrary extends Arbitrary {
|
|
|
3584
3413
|
return -safeMathMin$2(this.totalWeight * depthBenefit, safeMaxSafeInteger$1) || 0;
|
|
3585
3414
|
}
|
|
3586
3415
|
};
|
|
3587
|
-
|
|
3588
3416
|
//#endregion
|
|
3589
3417
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/oneof.js
|
|
3590
3418
|
function isOneOfContraints(param) {
|
|
@@ -3600,13 +3428,12 @@ function toWeightedArbitrary(maybeWeightedArbitrary) {
|
|
|
3600
3428
|
function oneof(...args) {
|
|
3601
3429
|
const constraints = args[0];
|
|
3602
3430
|
if (isOneOfContraints(constraints)) {
|
|
3603
|
-
const weightedArbs
|
|
3604
|
-
return FrequencyArbitrary.from(weightedArbs
|
|
3431
|
+
const weightedArbs = safeMap(safeSlice(args, 1), toWeightedArbitrary);
|
|
3432
|
+
return FrequencyArbitrary.from(weightedArbs, constraints, "fc.oneof");
|
|
3605
3433
|
}
|
|
3606
3434
|
const weightedArbs = safeMap(args, toWeightedArbitrary);
|
|
3607
3435
|
return FrequencyArbitrary.from(weightedArbs, {}, "fc.oneof");
|
|
3608
3436
|
}
|
|
3609
|
-
|
|
3610
3437
|
//#endregion
|
|
3611
3438
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/nat.js
|
|
3612
3439
|
const safeNumberIsInteger$3 = Number.isInteger;
|
|
@@ -3616,7 +3443,6 @@ function nat(arg) {
|
|
|
3616
3443
|
if (!safeNumberIsInteger$3(max)) throw new Error("fc.nat maximum value should be an integer");
|
|
3617
3444
|
return new IntegerArbitrary(0, max);
|
|
3618
3445
|
}
|
|
3619
|
-
|
|
3620
3446
|
//#endregion
|
|
3621
3447
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToMappedConstant.js
|
|
3622
3448
|
const safeObjectIs$1 = Object.is;
|
|
@@ -3678,7 +3504,6 @@ function indexToMappedConstantUnmapperFor(entries) {
|
|
|
3678
3504
|
return choiceIndex;
|
|
3679
3505
|
};
|
|
3680
3506
|
}
|
|
3681
|
-
|
|
3682
3507
|
//#endregion
|
|
3683
3508
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/mapToConstant.js
|
|
3684
3509
|
function computeNumChoices(options) {
|
|
@@ -3692,18 +3517,16 @@ function computeNumChoices(options) {
|
|
|
3692
3517
|
return numChoices;
|
|
3693
3518
|
}
|
|
3694
3519
|
function mapToConstant(...entries) {
|
|
3695
|
-
|
|
3696
|
-
return nat({ max: numChoices - 1 }).map(indexToMappedConstantMapperFor(entries), indexToMappedConstantUnmapperFor(entries));
|
|
3520
|
+
return nat({ max: computeNumChoices(entries) - 1 }).map(indexToMappedConstantMapperFor(entries), indexToMappedConstantUnmapperFor(entries));
|
|
3697
3521
|
}
|
|
3698
|
-
|
|
3699
3522
|
//#endregion
|
|
3700
3523
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/TokenizeString.js
|
|
3701
3524
|
function tokenizeString(patternsArb, value, minLength, maxLength) {
|
|
3702
3525
|
if (value.length === 0) {
|
|
3703
|
-
if (minLength > 0) return
|
|
3526
|
+
if (minLength > 0) return;
|
|
3704
3527
|
return [];
|
|
3705
3528
|
}
|
|
3706
|
-
if (maxLength <= 0) return
|
|
3529
|
+
if (maxLength <= 0) return;
|
|
3707
3530
|
const stack = [{
|
|
3708
3531
|
endIndexChunks: 0,
|
|
3709
3532
|
nextStartIndex: 1,
|
|
@@ -3733,9 +3556,7 @@ function tokenizeString(patternsArb, value, minLength, maxLength) {
|
|
|
3733
3556
|
}
|
|
3734
3557
|
}
|
|
3735
3558
|
}
|
|
3736
|
-
return void 0;
|
|
3737
3559
|
}
|
|
3738
|
-
|
|
3739
3560
|
//#endregion
|
|
3740
3561
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/PatternsToString.js
|
|
3741
3562
|
function patternsToStringMapper(tab) {
|
|
@@ -3758,7 +3579,6 @@ function patternsToStringUnmapperFor(patternsArb, constraints) {
|
|
|
3758
3579
|
return tokens;
|
|
3759
3580
|
};
|
|
3760
3581
|
}
|
|
3761
|
-
|
|
3762
3582
|
//#endregion
|
|
3763
3583
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SlicesForStringBuilder.js
|
|
3764
3584
|
const dangerousStrings = [
|
|
@@ -3790,9 +3610,9 @@ function computeCandidateStringLegacy(dangerous, charArbitrary, stringSplitter)
|
|
|
3790
3610
|
try {
|
|
3791
3611
|
candidate = stringSplitter(dangerous);
|
|
3792
3612
|
} catch (err) {
|
|
3793
|
-
return
|
|
3613
|
+
return;
|
|
3794
3614
|
}
|
|
3795
|
-
for (const entry of candidate) if (!charArbitrary.canShrinkWithoutContext(entry)) return
|
|
3615
|
+
for (const entry of candidate) if (!charArbitrary.canShrinkWithoutContext(entry)) return;
|
|
3796
3616
|
return candidate;
|
|
3797
3617
|
}
|
|
3798
3618
|
function createSlicesForStringLegacy(charArbitrary, stringSplitter) {
|
|
@@ -3822,7 +3642,6 @@ function createSlicesForString(charArbitrary, constraints) {
|
|
|
3822
3642
|
for (const slice of slices) if (patternsToStringUnmapperIsValidLength(slice, constraints)) safePush(slicesForConstraints, slice);
|
|
3823
3643
|
return slicesForConstraints;
|
|
3824
3644
|
}
|
|
3825
|
-
|
|
3826
3645
|
//#endregion
|
|
3827
3646
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/data/GraphemeRanges.js
|
|
3828
3647
|
const asciiAlphabetRanges = [[0, 127]];
|
|
@@ -4807,7 +4626,6 @@ const autonomousDecomposableGraphemeRanges = [
|
|
|
4807
4626
|
[119134, 119140],
|
|
4808
4627
|
[119227, 119232]
|
|
4809
4628
|
];
|
|
4810
|
-
|
|
4811
4629
|
//#endregion
|
|
4812
4630
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/GraphemeRangesHelpers.js
|
|
4813
4631
|
const safeStringFromCodePoint = String.fromCodePoint;
|
|
@@ -4845,8 +4663,7 @@ function intersectGraphemeRanges(rangesA, rangesB) {
|
|
|
4845
4663
|
const max = safeMathMin$1(rangeAMax, rangeBMax);
|
|
4846
4664
|
if (mergedRanges.length >= 1) {
|
|
4847
4665
|
const lastMergedRange = mergedRanges[mergedRanges.length - 1];
|
|
4848
|
-
|
|
4849
|
-
if (lastMergedRangeMax + 1 === min) {
|
|
4666
|
+
if ((lastMergedRange.length === 1 ? lastMergedRange[0] : lastMergedRange[1]) + 1 === min) {
|
|
4850
4667
|
min = lastMergedRange[0];
|
|
4851
4668
|
safePop(mergedRanges);
|
|
4852
4669
|
}
|
|
@@ -4858,7 +4675,6 @@ function intersectGraphemeRanges(rangesA, rangesB) {
|
|
|
4858
4675
|
}
|
|
4859
4676
|
return mergedRanges;
|
|
4860
4677
|
}
|
|
4861
|
-
|
|
4862
4678
|
//#endregion
|
|
4863
4679
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/StringUnitArbitrary.js
|
|
4864
4680
|
const registeredStringUnitInstancesMap = Object.create(null);
|
|
@@ -4893,7 +4709,6 @@ function getOrCreateStringUnitInstance(type, alphabet) {
|
|
|
4893
4709
|
function stringUnit(type, alphabet) {
|
|
4894
4710
|
return getOrCreateStringUnitInstance(type, alphabet);
|
|
4895
4711
|
}
|
|
4896
|
-
|
|
4897
4712
|
//#endregion
|
|
4898
4713
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/string.js
|
|
4899
4714
|
const safeObjectAssign$1 = Object.assign;
|
|
@@ -4912,10 +4727,8 @@ function string(constraints = {}) {
|
|
|
4912
4727
|
const charArbitrary = extractUnitArbitrary(constraints);
|
|
4913
4728
|
const unmapper = patternsToStringUnmapperFor(charArbitrary, constraints);
|
|
4914
4729
|
const experimentalCustomSlices = createSlicesForString(charArbitrary, constraints);
|
|
4915
|
-
|
|
4916
|
-
return array(charArbitrary, enrichedConstraints).map(patternsToStringMapper, unmapper);
|
|
4730
|
+
return array(charArbitrary, safeObjectAssign$1(safeObjectAssign$1({}, constraints), { experimentalCustomSlices })).map(patternsToStringMapper, unmapper);
|
|
4917
4731
|
}
|
|
4918
|
-
|
|
4919
4732
|
//#endregion
|
|
4920
4733
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ArrayInt64.js
|
|
4921
4734
|
const Zero64 = {
|
|
@@ -4964,10 +4777,9 @@ function substract64DataInternal(a, b) {
|
|
|
4964
4777
|
function substract64Internal(a, b) {
|
|
4965
4778
|
if (a.sign === 1 && b.sign === -1) {
|
|
4966
4779
|
const low = a.data[1] + b.data[1];
|
|
4967
|
-
const high = a.data[0] + b.data[0] + (low > 4294967295 ? 1 : 0);
|
|
4968
4780
|
return {
|
|
4969
4781
|
sign: 1,
|
|
4970
|
-
data: [
|
|
4782
|
+
data: [a.data[0] + b.data[0] + (low > 4294967295 ? 1 : 0) >>> 0, low >>> 0]
|
|
4971
4783
|
};
|
|
4972
4784
|
}
|
|
4973
4785
|
return {
|
|
@@ -5008,7 +4820,6 @@ function logLike64(a) {
|
|
|
5008
4820
|
data: [0, Math.floor(Math.log(a.data[0] * 4294967296 + a.data[1]) / Math.log(2))]
|
|
5009
4821
|
};
|
|
5010
4822
|
}
|
|
5011
|
-
|
|
5012
4823
|
//#endregion
|
|
5013
4824
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ArrayInt64Arbitrary.js
|
|
5014
4825
|
var ArrayInt64Arbitrary = class ArrayInt64Arbitrary extends Arbitrary {
|
|
@@ -5117,10 +4928,8 @@ var ArrayInt64Arbitrary = class ArrayInt64Arbitrary extends Arbitrary {
|
|
|
5117
4928
|
}
|
|
5118
4929
|
};
|
|
5119
4930
|
function arrayInt64(min, max) {
|
|
5120
|
-
|
|
5121
|
-
return arb;
|
|
4931
|
+
return new ArrayInt64Arbitrary(min, max);
|
|
5122
4932
|
}
|
|
5123
|
-
|
|
5124
4933
|
//#endregion
|
|
5125
4934
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DoubleHelpers.js
|
|
5126
4935
|
const safeNegativeInfinity$6 = Number.NEGATIVE_INFINITY;
|
|
@@ -5158,10 +4967,7 @@ function positiveNumberToInt64(n) {
|
|
|
5158
4967
|
return [~~(n / 4294967296), n >>> 0];
|
|
5159
4968
|
}
|
|
5160
4969
|
function indexInDoubleFromDecomp(exponent, significand) {
|
|
5161
|
-
if (exponent === -1022)
|
|
5162
|
-
const rescaledSignificand$1 = significand * 2 ** 52;
|
|
5163
|
-
return positiveNumberToInt64(rescaledSignificand$1);
|
|
5164
|
-
}
|
|
4970
|
+
if (exponent === -1022) return positiveNumberToInt64(significand * 2 ** 52);
|
|
5165
4971
|
const rescaledSignificand = (significand - 1) * 2 ** 52;
|
|
5166
4972
|
const exponentOnlyHigh = (exponent + 1023) * 2 ** 20;
|
|
5167
4973
|
const index = positiveNumberToInt64(rescaledSignificand);
|
|
@@ -5206,21 +5012,19 @@ function indexToDouble(index) {
|
|
|
5206
5012
|
if (index.data[0] < 2097152) return (index.data[0] * 4294967296 + index.data[1]) * 2 ** -1074;
|
|
5207
5013
|
const postIndexHigh = index.data[0] - 2097152;
|
|
5208
5014
|
const exponent = -1021 + (postIndexHigh >> 20);
|
|
5209
|
-
|
|
5210
|
-
return significand * 2 ** exponent;
|
|
5015
|
+
return (1 + ((postIndexHigh & 1048575) * 2 ** 32 + index.data[1]) * safeEpsilon) * 2 ** exponent;
|
|
5211
5016
|
}
|
|
5212
|
-
|
|
5213
5017
|
//#endregion
|
|
5214
5018
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatingOnlyHelpers.js
|
|
5215
5019
|
const safeNumberIsInteger$2 = Number.isInteger;
|
|
5216
5020
|
const safeObjectIs = Object.is;
|
|
5217
5021
|
const safeNegativeInfinity$5 = Number.NEGATIVE_INFINITY;
|
|
5218
5022
|
const safePositiveInfinity$5 = Number.POSITIVE_INFINITY;
|
|
5219
|
-
function refineConstraintsForFloatingOnly(constraints, maxValue, maxNonIntegerValue
|
|
5023
|
+
function refineConstraintsForFloatingOnly(constraints, maxValue, maxNonIntegerValue, onlyIntegersAfterThisValue) {
|
|
5220
5024
|
const { noDefaultInfinity = false, minExcluded = false, maxExcluded = false, min = noDefaultInfinity ? -maxValue : safeNegativeInfinity$5, max = noDefaultInfinity ? maxValue : safePositiveInfinity$5 } = constraints;
|
|
5221
|
-
const effectiveMin = minExcluded ? min < -maxNonIntegerValue
|
|
5222
|
-
const effectiveMax = maxExcluded ? max > maxNonIntegerValue
|
|
5223
|
-
|
|
5025
|
+
const effectiveMin = minExcluded ? min < -maxNonIntegerValue ? -onlyIntegersAfterThisValue : Math.max(min, -maxNonIntegerValue) : min === safeNegativeInfinity$5 ? Math.max(min, -onlyIntegersAfterThisValue) : Math.max(min, -maxNonIntegerValue);
|
|
5026
|
+
const effectiveMax = maxExcluded ? max > maxNonIntegerValue ? onlyIntegersAfterThisValue : Math.min(max, maxNonIntegerValue) : max === safePositiveInfinity$5 ? Math.min(max, onlyIntegersAfterThisValue) : Math.min(max, maxNonIntegerValue);
|
|
5027
|
+
return {
|
|
5224
5028
|
noDefaultInfinity: false,
|
|
5225
5029
|
minExcluded: minExcluded || (min !== safeNegativeInfinity$5 || minExcluded) && safeNumberIsInteger$2(effectiveMin),
|
|
5226
5030
|
maxExcluded: maxExcluded || (max !== safePositiveInfinity$5 || maxExcluded) && safeNumberIsInteger$2(effectiveMax),
|
|
@@ -5228,9 +5032,7 @@ function refineConstraintsForFloatingOnly(constraints, maxValue, maxNonIntegerVa
|
|
|
5228
5032
|
max: safeObjectIs(effectiveMax, 0) ? -0 : effectiveMax,
|
|
5229
5033
|
noNaN: constraints.noNaN || false
|
|
5230
5034
|
};
|
|
5231
|
-
return fullConstraints;
|
|
5232
5035
|
}
|
|
5233
|
-
|
|
5234
5036
|
//#endregion
|
|
5235
5037
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DoubleOnlyHelpers.js
|
|
5236
5038
|
const safeNegativeInfinity$4 = Number.NEGATIVE_INFINITY;
|
|
@@ -5242,13 +5044,12 @@ function refineConstraintsForDoubleOnly(constraints) {
|
|
|
5242
5044
|
return refineConstraintsForFloatingOnly(constraints, safeMaxValue$2, maxNonIntegerValue$1, onlyIntegersAfterThisValue$1);
|
|
5243
5045
|
}
|
|
5244
5046
|
function doubleOnlyMapper(value) {
|
|
5245
|
-
return value ===
|
|
5047
|
+
return value === 4503599627370496 ? safePositiveInfinity$4 : value === -4503599627370496 ? safeNegativeInfinity$4 : value;
|
|
5246
5048
|
}
|
|
5247
5049
|
function doubleOnlyUnmapper(value) {
|
|
5248
5050
|
if (typeof value !== "number") throw new Error("Unsupported type");
|
|
5249
5051
|
return value === safePositiveInfinity$4 ? onlyIntegersAfterThisValue$1 : value === safeNegativeInfinity$4 ? -onlyIntegersAfterThisValue$1 : value;
|
|
5250
5052
|
}
|
|
5251
|
-
|
|
5252
5053
|
//#endregion
|
|
5253
5054
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/double.js
|
|
5254
5055
|
const safeNumberIsInteger$1 = Number.isInteger;
|
|
@@ -5292,14 +5093,11 @@ function double(constraints = {}) {
|
|
|
5292
5093
|
if (!constraints.noInteger) return anyDouble(constraints);
|
|
5293
5094
|
return anyDouble(refineConstraintsForDoubleOnly(constraints)).map(doubleOnlyMapper, doubleOnlyUnmapper).filter(numberIsNotInteger$1);
|
|
5294
5095
|
}
|
|
5295
|
-
|
|
5296
5096
|
//#endregion
|
|
5297
5097
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatHelpers.js
|
|
5298
5098
|
const safeNegativeInfinity$2 = Number.NEGATIVE_INFINITY;
|
|
5299
5099
|
const safePositiveInfinity$2 = Number.POSITIVE_INFINITY;
|
|
5300
|
-
const MIN_VALUE_32 = 2 ** -126 * 2 ** -23;
|
|
5301
5100
|
const MAX_VALUE_32 = 2 ** 127 * (1 + (2 ** 23 - 1) / 2 ** 23);
|
|
5302
|
-
const EPSILON_32 = 2 ** -23;
|
|
5303
5101
|
const INDEX_POSITIVE_INFINITY = 2139095040;
|
|
5304
5102
|
const INDEX_NEGATIVE_INFINITY = -2139095041;
|
|
5305
5103
|
const f32 = new Float32Array(1);
|
|
@@ -5341,10 +5139,8 @@ function indexToFloat(index) {
|
|
|
5341
5139
|
if (index < 16777216) return index * 2 ** -149;
|
|
5342
5140
|
const postIndex = index - 16777216;
|
|
5343
5141
|
const exponent = -125 + (postIndex >> 23);
|
|
5344
|
-
|
|
5345
|
-
return significand * 2 ** exponent;
|
|
5142
|
+
return (1 + (postIndex & 8388607) / 8388608) * 2 ** exponent;
|
|
5346
5143
|
}
|
|
5347
|
-
|
|
5348
5144
|
//#endregion
|
|
5349
5145
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatOnlyHelpers.js
|
|
5350
5146
|
const safeNegativeInfinity$1 = Number.NEGATIVE_INFINITY;
|
|
@@ -5356,13 +5152,12 @@ function refineConstraintsForFloatOnly(constraints) {
|
|
|
5356
5152
|
return refineConstraintsForFloatingOnly(constraints, safeMaxValue, maxNonIntegerValue, onlyIntegersAfterThisValue);
|
|
5357
5153
|
}
|
|
5358
5154
|
function floatOnlyMapper(value) {
|
|
5359
|
-
return value ===
|
|
5155
|
+
return value === 8388608 ? safePositiveInfinity$1 : value === -8388608 ? safeNegativeInfinity$1 : value;
|
|
5360
5156
|
}
|
|
5361
5157
|
function floatOnlyUnmapper(value) {
|
|
5362
5158
|
if (typeof value !== "number") throw new Error("Unsupported type");
|
|
5363
5159
|
return value === safePositiveInfinity$1 ? onlyIntegersAfterThisValue : value === safeNegativeInfinity$1 ? -onlyIntegersAfterThisValue : value;
|
|
5364
5160
|
}
|
|
5365
|
-
|
|
5366
5161
|
//#endregion
|
|
5367
5162
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float.js
|
|
5368
5163
|
const safeNumberIsInteger = Number.isInteger;
|
|
@@ -5372,7 +5167,6 @@ const safeNegativeInfinity = Number.NEGATIVE_INFINITY;
|
|
|
5372
5167
|
const safePositiveInfinity = Number.POSITIVE_INFINITY;
|
|
5373
5168
|
const safeNaN = NaN;
|
|
5374
5169
|
function safeFloatToIndex(f, constraintsLabel) {
|
|
5375
|
-
const conversionTrick = "you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";
|
|
5376
5170
|
const errorMessage = "fc.float constraints." + constraintsLabel + " must be a 32-bit float - you can convert any double to a 32-bit float by using `Math.fround(myDouble)`";
|
|
5377
5171
|
if (safeNumberIsNaN(f) || safeMathFround(f) !== f) throw new Error(errorMessage);
|
|
5378
5172
|
return floatToIndex(f);
|
|
@@ -5413,7 +5207,6 @@ function float(constraints = {}) {
|
|
|
5413
5207
|
if (!constraints.noInteger) return anyFloat(constraints);
|
|
5414
5208
|
return anyFloat(refineConstraintsForFloatOnly(constraints)).map(floatOnlyMapper, floatOnlyUnmapper).filter(numberIsNotInteger);
|
|
5415
5209
|
}
|
|
5416
|
-
|
|
5417
5210
|
//#endregion
|
|
5418
5211
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/maxSafeInteger.js
|
|
5419
5212
|
const safeMinSafeInteger = Number.MIN_SAFE_INTEGER;
|
|
@@ -5421,7 +5214,6 @@ const safeMaxSafeInteger = Number.MAX_SAFE_INTEGER;
|
|
|
5421
5214
|
function maxSafeInteger() {
|
|
5422
5215
|
return new IntegerArbitrary(safeMinSafeInteger, safeMaxSafeInteger);
|
|
5423
5216
|
}
|
|
5424
|
-
|
|
5425
5217
|
//#endregion
|
|
5426
5218
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/CodePointsToString.js
|
|
5427
5219
|
function codePointsToStringMapper(tab) {
|
|
@@ -5431,7 +5223,6 @@ function codePointsToStringUnmapper(value) {
|
|
|
5431
5223
|
if (typeof value !== "string") throw new Error("Cannot unmap the passed value");
|
|
5432
5224
|
return [...value];
|
|
5433
5225
|
}
|
|
5434
|
-
|
|
5435
5226
|
//#endregion
|
|
5436
5227
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/LazyArbitrary.js
|
|
5437
5228
|
var LazyArbitrary = class extends Arbitrary {
|
|
@@ -5453,7 +5244,6 @@ var LazyArbitrary = class extends Arbitrary {
|
|
|
5453
5244
|
return this.underlying.shrink(value, context);
|
|
5454
5245
|
}
|
|
5455
5246
|
};
|
|
5456
|
-
|
|
5457
5247
|
//#endregion
|
|
5458
5248
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/letrec.js
|
|
5459
5249
|
const safeObjectCreate = Object.create;
|
|
@@ -5473,7 +5263,6 @@ function letrec(builder) {
|
|
|
5473
5263
|
}
|
|
5474
5264
|
return strictArbs;
|
|
5475
5265
|
}
|
|
5476
|
-
|
|
5477
5266
|
//#endregion
|
|
5478
5267
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float32Array.js
|
|
5479
5268
|
function toTypedMapper$1(data) {
|
|
@@ -5486,7 +5275,6 @@ function fromTypedUnmapper$1(value) {
|
|
|
5486
5275
|
function float32Array(constraints = {}) {
|
|
5487
5276
|
return array(float(constraints), constraints).map(toTypedMapper$1, fromTypedUnmapper$1);
|
|
5488
5277
|
}
|
|
5489
|
-
|
|
5490
5278
|
//#endregion
|
|
5491
5279
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float64Array.js
|
|
5492
5280
|
function toTypedMapper(data) {
|
|
@@ -5499,10 +5287,9 @@ function fromTypedUnmapper(value) {
|
|
|
5499
5287
|
function float64Array(constraints = {}) {
|
|
5500
5288
|
return array(double(constraints), constraints).map(toTypedMapper, fromTypedUnmapper);
|
|
5501
5289
|
}
|
|
5502
|
-
|
|
5503
5290
|
//#endregion
|
|
5504
5291
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/TypedIntArrayArbitraryBuilder.js
|
|
5505
|
-
var __rest =
|
|
5292
|
+
var __rest = function(s, e) {
|
|
5506
5293
|
var t = {};
|
|
5507
5294
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5508
5295
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") {
|
|
@@ -5524,49 +5311,41 @@ function typedIntArrayArbitraryArbitraryBuilder(constraints, defaultMin, default
|
|
|
5524
5311
|
return [...value];
|
|
5525
5312
|
});
|
|
5526
5313
|
}
|
|
5527
|
-
|
|
5528
5314
|
//#endregion
|
|
5529
5315
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int16Array.js
|
|
5530
5316
|
function int16Array(constraints = {}) {
|
|
5531
5317
|
return typedIntArrayArbitraryArbitraryBuilder(constraints, -32768, 32767, SInt16Array, integer);
|
|
5532
5318
|
}
|
|
5533
|
-
|
|
5534
5319
|
//#endregion
|
|
5535
5320
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int32Array.js
|
|
5536
5321
|
function int32Array(constraints = {}) {
|
|
5537
5322
|
return typedIntArrayArbitraryArbitraryBuilder(constraints, -2147483648, 2147483647, SInt32Array, integer);
|
|
5538
5323
|
}
|
|
5539
|
-
|
|
5540
5324
|
//#endregion
|
|
5541
5325
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int8Array.js
|
|
5542
5326
|
function int8Array(constraints = {}) {
|
|
5543
5327
|
return typedIntArrayArbitraryArbitraryBuilder(constraints, -128, 127, SInt8Array, integer);
|
|
5544
5328
|
}
|
|
5545
|
-
|
|
5546
5329
|
//#endregion
|
|
5547
5330
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint16Array.js
|
|
5548
5331
|
function uint16Array(constraints = {}) {
|
|
5549
5332
|
return typedIntArrayArbitraryArbitraryBuilder(constraints, 0, 65535, SUint16Array, integer);
|
|
5550
5333
|
}
|
|
5551
|
-
|
|
5552
5334
|
//#endregion
|
|
5553
5335
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint32Array.js
|
|
5554
5336
|
function uint32Array(constraints = {}) {
|
|
5555
5337
|
return typedIntArrayArbitraryArbitraryBuilder(constraints, 0, 4294967295, SUint32Array, integer);
|
|
5556
5338
|
}
|
|
5557
|
-
|
|
5558
5339
|
//#endregion
|
|
5559
5340
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint8Array.js
|
|
5560
5341
|
function uint8Array(constraints = {}) {
|
|
5561
5342
|
return typedIntArrayArbitraryArbitraryBuilder(constraints, 0, 255, SUint8Array, integer);
|
|
5562
5343
|
}
|
|
5563
|
-
|
|
5564
5344
|
//#endregion
|
|
5565
5345
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint8ClampedArray.js
|
|
5566
5346
|
function uint8ClampedArray(constraints = {}) {
|
|
5567
5347
|
return typedIntArrayArbitraryArbitraryBuilder(constraints, 0, 255, SUint8ClampedArray, integer);
|
|
5568
5348
|
}
|
|
5569
|
-
|
|
5570
5349
|
//#endregion
|
|
5571
5350
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/WithShrinkFromOtherArbitrary.js
|
|
5572
5351
|
function isSafeContext(context) {
|
|
@@ -5598,7 +5377,6 @@ var WithShrinkFromOtherArbitrary = class extends Arbitrary {
|
|
|
5598
5377
|
return this.shrinkerArbitrary.shrink(value, context.shrinkerContext).map(toShrinkerValue);
|
|
5599
5378
|
}
|
|
5600
5379
|
};
|
|
5601
|
-
|
|
5602
5380
|
//#endregion
|
|
5603
5381
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/RestrictedIntegerArbitraryBuilder.js
|
|
5604
5382
|
function restrictedIntegerArbitraryBuilder(min, maxGenerated, max) {
|
|
@@ -5607,13 +5385,11 @@ function restrictedIntegerArbitraryBuilder(min, maxGenerated, max) {
|
|
|
5607
5385
|
max: maxGenerated
|
|
5608
5386
|
});
|
|
5609
5387
|
if (maxGenerated === max) return generatorArbitrary;
|
|
5610
|
-
|
|
5388
|
+
return new WithShrinkFromOtherArbitrary(generatorArbitrary, integer({
|
|
5611
5389
|
min,
|
|
5612
5390
|
max
|
|
5613
|
-
});
|
|
5614
|
-
return new WithShrinkFromOtherArbitrary(generatorArbitrary, shrinkerArbitrary);
|
|
5391
|
+
}));
|
|
5615
5392
|
}
|
|
5616
|
-
|
|
5617
5393
|
//#endregion
|
|
5618
5394
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/sparseArray.js
|
|
5619
5395
|
const safeMathMin = Math.min;
|
|
@@ -5626,32 +5402,28 @@ function extractMaxIndex(indexesAndValues) {
|
|
|
5626
5402
|
return maxIndex;
|
|
5627
5403
|
}
|
|
5628
5404
|
function arrayFromItems(length, indexesAndValues) {
|
|
5629
|
-
const array
|
|
5405
|
+
const array = SArray(length);
|
|
5630
5406
|
for (let index = 0; index !== indexesAndValues.length; ++index) {
|
|
5631
5407
|
const it = indexesAndValues[index];
|
|
5632
|
-
if (it[0] < length) array
|
|
5408
|
+
if (it[0] < length) array[it[0]] = it[1];
|
|
5633
5409
|
}
|
|
5634
|
-
return array
|
|
5410
|
+
return array;
|
|
5635
5411
|
}
|
|
5636
5412
|
function sparseArray(arb, constraints = {}) {
|
|
5637
5413
|
const { size, minNumElements = 0, maxLength = MaxLengthUpperBound, maxNumElements = maxLength, noTrailingHole, depthIdentifier } = constraints;
|
|
5638
|
-
const
|
|
5639
|
-
const maxGeneratedLength = maxGeneratedLengthFromSizeForArbitrary(size, maxGeneratedNumElements, maxLength, constraints.maxLength !== void 0);
|
|
5414
|
+
const maxGeneratedLength = maxGeneratedLengthFromSizeForArbitrary(size, maxGeneratedLengthFromSizeForArbitrary(size, minNumElements, maxNumElements, constraints.maxNumElements !== void 0), maxLength, constraints.maxLength !== void 0);
|
|
5640
5415
|
if (minNumElements > maxLength) throw new Error(`The minimal number of non-hole elements cannot be higher than the maximal length of the array`);
|
|
5641
5416
|
if (minNumElements > maxNumElements) throw new Error(`The minimal number of non-hole elements cannot be higher than the maximal number of non-holes`);
|
|
5642
5417
|
const resultedMaxNumElements = safeMathMin(maxNumElements, maxLength);
|
|
5643
5418
|
const resultedSizeMaxNumElements = constraints.maxNumElements !== void 0 || size !== void 0 ? size : "=";
|
|
5644
|
-
const
|
|
5645
|
-
const maxIndexAuthorized = safeMathMax(maxLength - 1, 0);
|
|
5646
|
-
const sparseArrayNoTrailingHole = uniqueArray(tuple(restrictedIntegerArbitraryBuilder(0, maxGeneratedIndexAuthorized, maxIndexAuthorized), arb), {
|
|
5419
|
+
const sparseArrayNoTrailingHole = uniqueArray(tuple(restrictedIntegerArbitraryBuilder(0, safeMathMax(maxGeneratedLength - 1, 0), safeMathMax(maxLength - 1, 0)), arb), {
|
|
5647
5420
|
size: resultedSizeMaxNumElements,
|
|
5648
5421
|
minLength: minNumElements,
|
|
5649
5422
|
maxLength: resultedMaxNumElements,
|
|
5650
5423
|
selector: (item) => item[0],
|
|
5651
5424
|
depthIdentifier
|
|
5652
5425
|
}).map((items) => {
|
|
5653
|
-
|
|
5654
|
-
return arrayFromItems(lastIndex + 1, items);
|
|
5426
|
+
return arrayFromItems(extractMaxIndex(items) + 1, items);
|
|
5655
5427
|
}, (value) => {
|
|
5656
5428
|
if (!safeArrayIsArray(value)) throw new Error("Not supported entry type");
|
|
5657
5429
|
if (noTrailingHole && value.length !== 0 && !(value.length - 1 in value)) throw new Error("No trailing hole");
|
|
@@ -5670,7 +5442,6 @@ function sparseArray(arb, constraints = {}) {
|
|
|
5670
5442
|
return [value, value.length];
|
|
5671
5443
|
});
|
|
5672
5444
|
}
|
|
5673
|
-
|
|
5674
5445
|
//#endregion
|
|
5675
5446
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/ArrayToMap.js
|
|
5676
5447
|
function arrayToMapMapper(data) {
|
|
@@ -5681,7 +5452,6 @@ function arrayToMapUnmapper(value) {
|
|
|
5681
5452
|
if (!("constructor" in value) || value.constructor !== Map) throw new Error("Incompatible instance received: should be of exact type Map");
|
|
5682
5453
|
return Array.from(value);
|
|
5683
5454
|
}
|
|
5684
|
-
|
|
5685
5455
|
//#endregion
|
|
5686
5456
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/ArrayToSet.js
|
|
5687
5457
|
function arrayToSetMapper(data) {
|
|
@@ -5692,7 +5462,6 @@ function arrayToSetUnmapper(value) {
|
|
|
5692
5462
|
if (!("constructor" in value) || value.constructor !== Set) throw new Error("Incompatible instance received: should be of exact type Set");
|
|
5693
5463
|
return Array.from(value);
|
|
5694
5464
|
}
|
|
5695
|
-
|
|
5696
5465
|
//#endregion
|
|
5697
5466
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/AnyArbitraryBuilder.js
|
|
5698
5467
|
function mapOf(ka, va, maxKeys, size, depthIdentifier) {
|
|
@@ -5761,17 +5530,14 @@ function anyArbitraryBuilder(constraints) {
|
|
|
5761
5530
|
object: dictOf(tie("keys"), tie("anything"), maxKeys, size, depthIdentifier, constraints.withNullPrototype)
|
|
5762
5531
|
})).anything;
|
|
5763
5532
|
}
|
|
5764
|
-
|
|
5765
5533
|
//#endregion
|
|
5766
5534
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/fullUnicodeString.js
|
|
5767
5535
|
const safeObjectAssign = Object.assign;
|
|
5768
5536
|
function fullUnicodeString(constraints = {}) {
|
|
5769
5537
|
const charArbitrary = fullUnicode();
|
|
5770
5538
|
const experimentalCustomSlices = createSlicesForStringLegacy(charArbitrary, codePointsToStringUnmapper);
|
|
5771
|
-
|
|
5772
|
-
return array(charArbitrary, enrichedConstraints).map(codePointsToStringMapper, codePointsToStringUnmapper);
|
|
5539
|
+
return array(charArbitrary, safeObjectAssign(safeObjectAssign({}, constraints), { experimentalCustomSlices })).map(codePointsToStringMapper, codePointsToStringUnmapper);
|
|
5773
5540
|
}
|
|
5774
|
-
|
|
5775
5541
|
//#endregion
|
|
5776
5542
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/UnboxedToBoxed.js
|
|
5777
5543
|
function unboxedToBoxedMapper(value) {
|
|
@@ -5786,13 +5552,11 @@ function unboxedToBoxedUnmapper(value) {
|
|
|
5786
5552
|
if (typeof value !== "object" || value === null || !("constructor" in value)) return value;
|
|
5787
5553
|
return value.constructor === SBoolean || value.constructor === SNumber || value.constructor === SString ? value.valueOf() : value;
|
|
5788
5554
|
}
|
|
5789
|
-
|
|
5790
5555
|
//#endregion
|
|
5791
5556
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/BoxedArbitraryBuilder.js
|
|
5792
5557
|
function boxedArbitraryBuilder(arb) {
|
|
5793
5558
|
return arb.map(unboxedToBoxedMapper, unboxedToBoxedUnmapper);
|
|
5794
5559
|
}
|
|
5795
|
-
|
|
5796
5560
|
//#endregion
|
|
5797
5561
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/QualifiedObjectConstraints.js
|
|
5798
5562
|
function defaultValues(constraints, stringArbitrary) {
|
|
@@ -5836,13 +5600,11 @@ function toQualifiedObjectConstraints(settings = {}) {
|
|
|
5836
5600
|
withSparseArray: orDefault(settings.withSparseArray, false)
|
|
5837
5601
|
};
|
|
5838
5602
|
}
|
|
5839
|
-
|
|
5840
5603
|
//#endregion
|
|
5841
5604
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/anything.js
|
|
5842
5605
|
function anything(constraints) {
|
|
5843
5606
|
return anyArbitraryBuilder(toQualifiedObjectConstraints(constraints));
|
|
5844
5607
|
}
|
|
5845
|
-
|
|
5846
5608
|
//#endregion
|
|
5847
5609
|
//#region src/actor.ts
|
|
5848
5610
|
/**
|
|
@@ -5858,12 +5620,12 @@ function isActor(object) {
|
|
|
5858
5620
|
* @param actor The actor to get the type name of.
|
|
5859
5621
|
* @returns The type name of the given actor.
|
|
5860
5622
|
*/
|
|
5861
|
-
function getActorTypeName(actor
|
|
5862
|
-
if (actor
|
|
5863
|
-
else if (actor
|
|
5864
|
-
else if (actor
|
|
5865
|
-
else if (actor
|
|
5866
|
-
else if (actor
|
|
5623
|
+
function getActorTypeName(actor) {
|
|
5624
|
+
if (actor instanceof Application) return "Application";
|
|
5625
|
+
else if (actor instanceof Group) return "Group";
|
|
5626
|
+
else if (actor instanceof Organization) return "Organization";
|
|
5627
|
+
else if (actor instanceof Person) return "Person";
|
|
5628
|
+
else if (actor instanceof Service) return "Service";
|
|
5867
5629
|
throw new Error("Unknown actor type.");
|
|
5868
5630
|
}
|
|
5869
5631
|
/**
|
|
@@ -5905,16 +5667,14 @@ function getActorClassByTypeName(typeName) {
|
|
|
5905
5667
|
* handle.
|
|
5906
5668
|
* @since 0.4.0
|
|
5907
5669
|
*/
|
|
5908
|
-
async function getActorHandle(actor
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
if (actor$1.id != null) span.setAttribute("activitypub.actor.id", actor$1.id.href);
|
|
5914
|
-
span.setAttribute("activitypub.actor.type", getTypeId(actor$1).href);
|
|
5670
|
+
async function getActorHandle(actor, options = {}) {
|
|
5671
|
+
return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("activitypub.get_actor_handle", async (span) => {
|
|
5672
|
+
if (isActor(actor)) {
|
|
5673
|
+
if (actor.id != null) span.setAttribute("activitypub.actor.id", actor.id.href);
|
|
5674
|
+
span.setAttribute("activitypub.actor.type", getTypeId(actor).href);
|
|
5915
5675
|
}
|
|
5916
5676
|
try {
|
|
5917
|
-
return await getActorHandleInternal(actor
|
|
5677
|
+
return await getActorHandleInternal(actor, options);
|
|
5918
5678
|
} catch (error) {
|
|
5919
5679
|
span.setStatus({
|
|
5920
5680
|
code: SpanStatusCode.ERROR,
|
|
@@ -5926,8 +5686,8 @@ async function getActorHandle(actor$1, options = {}) {
|
|
|
5926
5686
|
}
|
|
5927
5687
|
});
|
|
5928
5688
|
}
|
|
5929
|
-
async function getActorHandleInternal(actor
|
|
5930
|
-
const actorId = actor
|
|
5689
|
+
async function getActorHandleInternal(actor, options = {}) {
|
|
5690
|
+
const actorId = actor instanceof URL ? actor : actor.id;
|
|
5931
5691
|
if (actorId != null) {
|
|
5932
5692
|
const result = await lookupWebFinger(actorId, {
|
|
5933
5693
|
userAgent: options.userAgent,
|
|
@@ -5939,14 +5699,13 @@ async function getActorHandleInternal(actor$1, options = {}) {
|
|
|
5939
5699
|
for (const alias of aliases) {
|
|
5940
5700
|
const match = alias.match(/^acct:([^@]+)@([^@]+)$/);
|
|
5941
5701
|
if (match != null) {
|
|
5942
|
-
|
|
5943
|
-
if (hostname !== actorId.hostname && !await verifyCrossOriginActorHandle(actorId.href, alias, options.userAgent, options.tracerProvider)) continue;
|
|
5702
|
+
if (new URL(`https://${match[2]}/`).hostname !== actorId.hostname && !await verifyCrossOriginActorHandle(actorId.href, alias, options.userAgent, options.tracerProvider)) continue;
|
|
5944
5703
|
return normalizeActorHandle(`@${match[1]}@${match[2]}`, options);
|
|
5945
5704
|
}
|
|
5946
5705
|
}
|
|
5947
5706
|
}
|
|
5948
5707
|
}
|
|
5949
|
-
if (!(actor
|
|
5708
|
+
if (!(actor instanceof URL) && actor.preferredUsername != null && actor.id != null) return normalizeActorHandle(`@${actor.preferredUsername}@${actor.id.host}`, options);
|
|
5950
5709
|
throw new TypeError("Actor does not have enough information to get the handle.");
|
|
5951
5710
|
}
|
|
5952
5711
|
async function verifyCrossOriginActorHandle(actorId, alias, userAgent, tracerProvider) {
|
|
@@ -5955,7 +5714,7 @@ async function verifyCrossOriginActorHandle(actorId, alias, userAgent, tracerPro
|
|
|
5955
5714
|
tracerProvider
|
|
5956
5715
|
});
|
|
5957
5716
|
if (response == null) return false;
|
|
5958
|
-
for (const alias
|
|
5717
|
+
for (const alias of response.aliases ?? []) if (new URL(alias).href === actorId) return true;
|
|
5959
5718
|
return false;
|
|
5960
5719
|
}
|
|
5961
5720
|
/**
|
|
@@ -5978,7 +5737,6 @@ function normalizeActorHandle(handle, options = {}) {
|
|
|
5978
5737
|
const user = handle.substring(0, atPos);
|
|
5979
5738
|
return options.trimLeadingAt ? `${user}@${domain}` : `@${user}@${domain}`;
|
|
5980
5739
|
}
|
|
5981
|
-
|
|
5982
5740
|
//#endregion
|
|
5983
5741
|
//#region src/actor.test.ts
|
|
5984
5742
|
function actorClass() {
|
|
@@ -5991,7 +5749,7 @@ function actor() {
|
|
|
5991
5749
|
return actorClassAndInstance().map(([, instance]) => instance);
|
|
5992
5750
|
}
|
|
5993
5751
|
test("isActor()", () => {
|
|
5994
|
-
assert(property(actor(), (actor
|
|
5752
|
+
assert(property(actor(), (actor) => ok(isActor(actor))));
|
|
5995
5753
|
assert(property(anything({
|
|
5996
5754
|
withBigInt: true,
|
|
5997
5755
|
withBoxedValues: true,
|
|
@@ -6023,13 +5781,13 @@ test({
|
|
|
6023
5781
|
headers: { "Content-Type": "application/jrd+json" }
|
|
6024
5782
|
});
|
|
6025
5783
|
const actorId = new URL("https://foo.example.com/@john");
|
|
6026
|
-
const actor
|
|
5784
|
+
const actor = new Person({
|
|
6027
5785
|
id: actorId,
|
|
6028
5786
|
preferredUsername: "john"
|
|
6029
5787
|
});
|
|
6030
5788
|
await t.step("WebFinger subject", async () => {
|
|
6031
|
-
deepStrictEqual(await getActorHandle(actor
|
|
6032
|
-
deepStrictEqual(await getActorHandle(actor
|
|
5789
|
+
deepStrictEqual(await getActorHandle(actor), "@johndoe@foo.example.com");
|
|
5790
|
+
deepStrictEqual(await getActorHandle(actor, { trimLeadingAt: true }), "johndoe@foo.example.com");
|
|
6033
5791
|
deepStrictEqual(await getActorHandle(actorId), "@johndoe@foo.example.com");
|
|
6034
5792
|
deepStrictEqual(await getActorHandle(actorId, { trimLeadingAt: true }), "johndoe@foo.example.com");
|
|
6035
5793
|
});
|
|
@@ -6042,8 +5800,8 @@ test({
|
|
|
6042
5800
|
headers: { "Content-Type": "application/jrd+json" }
|
|
6043
5801
|
});
|
|
6044
5802
|
await t.step("WebFinger aliases", async () => {
|
|
6045
|
-
deepStrictEqual(await getActorHandle(actor
|
|
6046
|
-
deepStrictEqual(await getActorHandle(actor
|
|
5803
|
+
deepStrictEqual(await getActorHandle(actor), "@johndoe@foo.example.com");
|
|
5804
|
+
deepStrictEqual(await getActorHandle(actor, { trimLeadingAt: true }), "johndoe@foo.example.com");
|
|
6047
5805
|
deepStrictEqual(await getActorHandle(actorId), "@johndoe@foo.example.com");
|
|
6048
5806
|
deepStrictEqual(await getActorHandle(actorId, { trimLeadingAt: true }), "johndoe@foo.example.com");
|
|
6049
5807
|
});
|
|
@@ -6055,12 +5813,12 @@ test({
|
|
|
6055
5813
|
headers: { "Content-Type": "application/jrd+json" }
|
|
6056
5814
|
});
|
|
6057
5815
|
await t.step("cross-origin WebFinger resources", async () => {
|
|
6058
|
-
deepStrictEqual(await getActorHandle(actor
|
|
5816
|
+
deepStrictEqual(await getActorHandle(actor), "@john@bar.example.com");
|
|
6059
5817
|
});
|
|
6060
5818
|
esm_default.removeRoutes();
|
|
6061
5819
|
esm_default.get("begin:https://foo.example.com/.well-known/webfinger?", { status: 404 });
|
|
6062
5820
|
await t.step("no WebFinger", async () => {
|
|
6063
|
-
deepStrictEqual(await getActorHandle(actor
|
|
5821
|
+
deepStrictEqual(await getActorHandle(actor), "@john@foo.example.com");
|
|
6064
5822
|
rejects(() => getActorHandle(actorId), TypeError);
|
|
6065
5823
|
});
|
|
6066
5824
|
esm_default.hardReset();
|
|
@@ -6091,5 +5849,5 @@ test("normalizeActorHandle()", () => {
|
|
|
6091
5849
|
throws(() => normalizeActorHandle("foo@bar.com@baz.com"));
|
|
6092
5850
|
throws(() => normalizeActorHandle("@foo@bar.com@baz.com"));
|
|
6093
5851
|
});
|
|
6094
|
-
|
|
6095
|
-
|
|
5852
|
+
//#endregion
|
|
5853
|
+
export {};
|