@orkestrel/contract 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/core/index.cjs +97 -135
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +45 -73
- package/dist/src/core/index.d.ts +45 -73
- package/dist/src/core/index.js +97 -136
- package/dist/src/core/index.js.map +1 -1
- package/package.json +19 -13
package/dist/src/core/index.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
//#region src/core/constants.ts
|
|
2
2
|
/**
|
|
3
|
+
* The registry-global key used to recognize {@link ContractError} values across
|
|
4
|
+
* package copies.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The descriptor stores the branded value itself. Recognition compares that
|
|
8
|
+
* identity, so a transparent proxy cannot forward its target's brand as its
|
|
9
|
+
* own. The registry makes the key discoverable; it is a recognition mechanism,
|
|
10
|
+
* not an unforgeable provenance marker.
|
|
11
|
+
*/
|
|
12
|
+
var CONTRACT_ERROR_BRAND = Symbol.for("@orkestrel/contract.error");
|
|
13
|
+
/**
|
|
3
14
|
* Every host operation this package dispatches through, captured while this
|
|
4
15
|
* module evaluates.
|
|
5
16
|
*
|
|
@@ -446,11 +457,9 @@ var FORMAT_PATTERNS = Object.freeze({
|
|
|
446
457
|
* ```
|
|
447
458
|
*/
|
|
448
459
|
var ContractError = class ContractError extends Error {
|
|
449
|
-
static #hasOwn = Object.hasOwn;
|
|
450
460
|
name = "ContractError";
|
|
451
461
|
code;
|
|
452
462
|
context;
|
|
453
|
-
#brand = true;
|
|
454
463
|
/**
|
|
455
464
|
* Create a contract error.
|
|
456
465
|
*
|
|
@@ -458,117 +467,44 @@ var ContractError = class ContractError extends Error {
|
|
|
458
467
|
* @param options - Machine-readable category, optional context, and optional cause
|
|
459
468
|
*/
|
|
460
469
|
constructor(message, options) {
|
|
461
|
-
super(message,
|
|
470
|
+
super(message, INTRINSICS.own(options, "cause") ? { cause: options.cause } : void 0);
|
|
471
|
+
INTRINSICS.define(this, CONTRACT_ERROR_BRAND, {
|
|
472
|
+
value: this,
|
|
473
|
+
configurable: true
|
|
474
|
+
});
|
|
462
475
|
this.code = options.code;
|
|
463
|
-
this.context =
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Hand the module the branded recognition test.
|
|
467
|
-
*
|
|
468
|
-
* @remarks
|
|
469
|
-
* The bootstrap seam, and deliberately NOT a spelling of the recognition
|
|
470
|
-
* question. Private-name membership is legal only inside this class body, so
|
|
471
|
-
* something must bridge the class to the module — and the previous bridge was
|
|
472
|
-
* a static that ANSWERED the question, `ContractError.owns(value)`. That
|
|
473
|
-
* reintroduced, verbatim, the poisonable surface the private brand was chosen
|
|
474
|
-
* to remove: one assignment made the package fail to recognize its own errors,
|
|
475
|
-
* so an engine rewrapped an error it had authored as an unreadable failure,
|
|
476
|
-
* and a throwing assignment put the caller's raw value through fifteen public
|
|
477
|
-
* doors.
|
|
478
|
-
*
|
|
479
|
-
* This hands over the CLOSURE instead: {@link isContractError} calls it and
|
|
480
|
-
* applies the result, so the only member on the recognition path hands the
|
|
481
|
-
* test over rather than answering with it. That per-call read is not a seam,
|
|
482
|
-
* because the static block below pins this member as a non-writable,
|
|
483
|
-
* non-configurable own data property.
|
|
484
|
-
*
|
|
485
|
-
* An earlier round argued the pin needed no further defence, because a static
|
|
486
|
-
* block runs during class definition and no order — this module's, an
|
|
487
|
-
* importer's, or a module that evaluated first — reaches `ContractError.guard`
|
|
488
|
-
* before the block runs. That is true and it answers the wrong question.
|
|
489
|
-
* INSTALLING IS NOT READING. The concern was never that something reads the
|
|
490
|
-
* member unpinned; it was whether the pin installs at all, and the pin is one
|
|
491
|
-
* live dispatch through `Object.defineProperty`. A module that evaluated
|
|
492
|
-
* first can replace it with a selective no-op, after which the block runs,
|
|
493
|
-
* returns, installs nothing, and every later read finds a writable member
|
|
494
|
-
* again — the whole `owns` defect restored, invisibly, in a realm where every
|
|
495
|
-
* shipped test still passes.
|
|
496
|
-
*
|
|
497
|
-
* So the block VERIFIES its own work and refuses to define the class when the
|
|
498
|
-
* pin did not take. A silent failure becomes a loud one at import. The
|
|
499
|
-
* residual is named rather than denied: an adversary who also answers the
|
|
500
|
-
* verifying descriptor read defeats it, and that adversary already chose what
|
|
501
|
-
* every capture in this package holds.
|
|
502
|
-
*
|
|
503
|
-
* @returns The total recognition guard `isContractError` publishes
|
|
504
|
-
*
|
|
505
|
-
* @example
|
|
506
|
-
* ```ts
|
|
507
|
-
* ContractError.guard()(new ContractError('x', { code: 'clone' })) // true
|
|
508
|
-
* ```
|
|
509
|
-
*/
|
|
510
|
-
static guard() {
|
|
511
|
-
return ContractError.#recognizes;
|
|
512
|
-
}
|
|
513
|
-
static #recognizes(value) {
|
|
514
|
-
if (typeof value !== "object" || value === null) return false;
|
|
515
|
-
try {
|
|
516
|
-
return #brand in value && value.#brand === true;
|
|
517
|
-
} catch {
|
|
518
|
-
return false;
|
|
519
|
-
}
|
|
476
|
+
this.context = INTRINSICS.own(options, "context") ? options.context : void 0;
|
|
520
477
|
}
|
|
521
478
|
static {
|
|
522
|
-
|
|
523
|
-
writable: false,
|
|
524
|
-
configurable: false
|
|
525
|
-
});
|
|
526
|
-
const guard = Object.getOwnPropertyDescriptor(this, "guard");
|
|
527
|
-
if (guard?.writable !== false || guard.configurable !== false) throw new ContractError("ContractError: the recognition pin could not be installed", { code: "structure" });
|
|
528
|
-
const members = Reflect.ownKeys(this.prototype);
|
|
479
|
+
const members = INTRINSICS.members(this.prototype);
|
|
529
480
|
for (let index = 0; index < members.length; index += 1) {
|
|
530
481
|
const key = members[index];
|
|
531
482
|
if (key === void 0) continue;
|
|
532
|
-
|
|
483
|
+
INTRINSICS.define(this.prototype, key, {
|
|
533
484
|
writable: false,
|
|
534
485
|
configurable: false
|
|
535
486
|
});
|
|
536
|
-
const pinned =
|
|
487
|
+
const pinned = INTRINSICS.describe(this.prototype, key);
|
|
537
488
|
if (pinned?.writable !== false || pinned.configurable !== false) throw new ContractError("ContractError: a prototype member could not be pinned", { code: "structure" });
|
|
538
489
|
}
|
|
539
490
|
}
|
|
540
491
|
};
|
|
541
492
|
/**
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
* @remarks
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
554
|
-
* The retrieved form was tried and was wrong twice over: a module-scope binding
|
|
555
|
-
* bound to a computed value is module DATA, which belongs in a data kind file
|
|
556
|
-
* and not in the file that owns the error classes and their guards; and the
|
|
557
|
-
* single read it bought guarded a window that does not exist, since the pin is
|
|
558
|
-
* installed during class definition and no code can observe this member before
|
|
559
|
-
* it. Reading a permanently pinned own data property per call buys the caller
|
|
560
|
-
* nothing, so the guard is spelled as what it is.
|
|
561
|
-
*
|
|
562
|
-
* Recognition is realm-local and identity-based: a value from another copy of
|
|
563
|
-
* this module is not this class's error, exactly as `instanceof` reported; a
|
|
564
|
-
* `Proxy` over a genuine error is refused, because a proxy holds no private
|
|
565
|
-
* field of its target; and `Reflect.construct(ContractError, args, Foreign)` IS
|
|
566
|
-
* recognized, because that construction genuinely ran this constructor and only
|
|
567
|
-
* the prototype was the caller's choice. That last consequence is a widening
|
|
568
|
-
* rather than a narrowing, and it is named rather than left to be discovered.
|
|
493
|
+
* Checks whether an unknown value is a {@link ContractError}.
|
|
494
|
+
*
|
|
495
|
+
* @remarks
|
|
496
|
+
* Recognition combines a global own-property brand with the native `Error`
|
|
497
|
+
* base, a subclass prototype, the fixed name, and a declared contract code.
|
|
498
|
+
* The brand stores the error itself and recognition requires that exact
|
|
499
|
+
* identity. A transparent proxy is therefore refused because its forwarded
|
|
500
|
+
* descriptor still stores the target, not the proxy.
|
|
501
|
+
* The brand is recognized across duplicate installations and ESM/CommonJS
|
|
502
|
+
* module copies at 0.0.13 or later. A copy earlier than 0.0.13 stamps no brand,
|
|
503
|
+
* so an error it throws stays outside the type, and so does a plain or
|
|
504
|
+
* property-only lookalike.
|
|
569
505
|
*
|
|
570
506
|
* @param value - The value to inspect
|
|
571
|
-
* @returns
|
|
507
|
+
* @returns True only for a `ContractError` instance; false otherwise
|
|
572
508
|
*
|
|
573
509
|
* @example
|
|
574
510
|
* ```ts
|
|
@@ -577,7 +513,16 @@ var ContractError = class ContractError extends Error {
|
|
|
577
513
|
* ```
|
|
578
514
|
*/
|
|
579
515
|
function isContractError(value) {
|
|
580
|
-
|
|
516
|
+
if (typeof value !== "object" || value === null) return false;
|
|
517
|
+
try {
|
|
518
|
+
if (!(value instanceof INTRINSICS.error) || INTRINSICS.prototype(value) === INTRINSICS.error.prototype) return false;
|
|
519
|
+
if (value.name !== "ContractError" || !("code" in value)) return false;
|
|
520
|
+
if (INTRINSICS.describe(value, CONTRACT_ERROR_BRAND)?.value !== value) return false;
|
|
521
|
+
const code = value.code;
|
|
522
|
+
return code === "bound" || code === "range" || code === "empty" || code === "placement" || code === "structure" || code === "literal" || code === "cycle" || code === "pattern" || code === "generate" || code === "random" || code === "clone" || code === "depth" || code === "expansion";
|
|
523
|
+
} catch {
|
|
524
|
+
return false;
|
|
525
|
+
}
|
|
581
526
|
}
|
|
582
527
|
//#endregion
|
|
583
528
|
//#region src/core/validators.ts
|
|
@@ -6557,28 +6502,38 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6557
6502
|
static #weakMap = WeakMap;
|
|
6558
6503
|
static #visits = 0;
|
|
6559
6504
|
static #scope = 0;
|
|
6505
|
+
static #emptyStack = [];
|
|
6506
|
+
static #emptyNodes = [];
|
|
6507
|
+
static #emptyOrder = [];
|
|
6508
|
+
static #emptySchemas = [];
|
|
6509
|
+
static #emptyGuards = [];
|
|
6510
|
+
static #emptyParsers = [];
|
|
6511
|
+
static #emptyAudits = [];
|
|
6512
|
+
static #emptyReports = [];
|
|
6513
|
+
static #emptySeeds = [];
|
|
6514
|
+
static {
|
|
6515
|
+
INTRINSICS.freeze(ContractCompiler.#emptyStack);
|
|
6516
|
+
INTRINSICS.freeze(ContractCompiler.#emptyNodes);
|
|
6517
|
+
INTRINSICS.freeze(ContractCompiler.#emptyOrder);
|
|
6518
|
+
INTRINSICS.freeze(ContractCompiler.#emptySchemas);
|
|
6519
|
+
INTRINSICS.freeze(ContractCompiler.#emptyGuards);
|
|
6520
|
+
INTRINSICS.freeze(ContractCompiler.#emptyParsers);
|
|
6521
|
+
INTRINSICS.freeze(ContractCompiler.#emptyAudits);
|
|
6522
|
+
INTRINSICS.freeze(ContractCompiler.#emptyReports);
|
|
6523
|
+
INTRINSICS.freeze(ContractCompiler.#emptySeeds);
|
|
6524
|
+
}
|
|
6560
6525
|
#source;
|
|
6561
6526
|
#state;
|
|
6562
6527
|
#stack;
|
|
6563
|
-
#emptyStack;
|
|
6564
6528
|
#nodes;
|
|
6565
|
-
#emptyNodes;
|
|
6566
6529
|
#index;
|
|
6567
|
-
#emptyIndex;
|
|
6568
6530
|
#order;
|
|
6569
|
-
#emptyOrder;
|
|
6570
6531
|
#schemas;
|
|
6571
|
-
#emptySchemas;
|
|
6572
6532
|
#guards;
|
|
6573
|
-
#emptyGuards;
|
|
6574
6533
|
#parsers;
|
|
6575
|
-
#emptyParsers;
|
|
6576
6534
|
#audits;
|
|
6577
|
-
#emptyAudits;
|
|
6578
6535
|
#reports;
|
|
6579
|
-
#emptyReports;
|
|
6580
6536
|
#seeds;
|
|
6581
|
-
#emptySeeds;
|
|
6582
6537
|
#schema;
|
|
6583
6538
|
#guard;
|
|
6584
6539
|
#parser;
|
|
@@ -6595,25 +6550,15 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6595
6550
|
this.#source = shape;
|
|
6596
6551
|
this.#state = { phase: "ready" };
|
|
6597
6552
|
this.#stack = [];
|
|
6598
|
-
this.#emptyStack = [];
|
|
6599
6553
|
this.#nodes = [];
|
|
6600
|
-
this.#emptyNodes = [];
|
|
6601
6554
|
this.#index = new ContractCompiler.#weakMap();
|
|
6602
|
-
this.#emptyIndex = new ContractCompiler.#weakMap();
|
|
6603
6555
|
this.#order = [];
|
|
6604
|
-
this.#emptyOrder = [];
|
|
6605
6556
|
this.#schemas = [];
|
|
6606
|
-
this.#emptySchemas = [];
|
|
6607
6557
|
this.#guards = [];
|
|
6608
|
-
this.#emptyGuards = [];
|
|
6609
6558
|
this.#parsers = [];
|
|
6610
|
-
this.#emptyParsers = [];
|
|
6611
6559
|
this.#audits = [];
|
|
6612
|
-
this.#emptyAudits = [];
|
|
6613
6560
|
this.#reports = [];
|
|
6614
|
-
this.#emptyReports = [];
|
|
6615
6561
|
this.#seeds = [];
|
|
6616
|
-
this.#emptySeeds = [];
|
|
6617
6562
|
this.#schema = void 0;
|
|
6618
6563
|
this.#guard = void 0;
|
|
6619
6564
|
this.#parser = void 0;
|
|
@@ -6735,16 +6680,16 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6735
6680
|
}
|
|
6736
6681
|
#release() {
|
|
6737
6682
|
this.#source = void 0;
|
|
6738
|
-
this.#stack =
|
|
6739
|
-
this.#nodes =
|
|
6740
|
-
this.#index =
|
|
6741
|
-
this.#order =
|
|
6742
|
-
this.#schemas =
|
|
6743
|
-
this.#guards =
|
|
6744
|
-
this.#parsers =
|
|
6745
|
-
this.#audits =
|
|
6746
|
-
this.#reports =
|
|
6747
|
-
this.#seeds =
|
|
6683
|
+
this.#stack = ContractCompiler.#emptyStack;
|
|
6684
|
+
this.#nodes = ContractCompiler.#emptyNodes;
|
|
6685
|
+
this.#index = void 0;
|
|
6686
|
+
this.#order = ContractCompiler.#emptyOrder;
|
|
6687
|
+
this.#schemas = ContractCompiler.#emptySchemas;
|
|
6688
|
+
this.#guards = ContractCompiler.#emptyGuards;
|
|
6689
|
+
this.#parsers = ContractCompiler.#emptyParsers;
|
|
6690
|
+
this.#audits = ContractCompiler.#emptyAudits;
|
|
6691
|
+
this.#reports = ContractCompiler.#emptyReports;
|
|
6692
|
+
this.#seeds = ContractCompiler.#emptySeeds;
|
|
6748
6693
|
}
|
|
6749
6694
|
#prepare() {
|
|
6750
6695
|
if (this.#nodes.length > 0) return;
|
|
@@ -6764,6 +6709,14 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6764
6709
|
this.#source = void 0;
|
|
6765
6710
|
}
|
|
6766
6711
|
#discover(root) {
|
|
6712
|
+
const known = this.#index;
|
|
6713
|
+
if (known === void 0) throw new ContractError("ContractCompiler: the prepared index is unavailable", {
|
|
6714
|
+
code: "structure",
|
|
6715
|
+
context: {
|
|
6716
|
+
path: [],
|
|
6717
|
+
shape: "contract"
|
|
6718
|
+
}
|
|
6719
|
+
});
|
|
6767
6720
|
this.#stack[this.#stack.length] = {
|
|
6768
6721
|
operation: "enter",
|
|
6769
6722
|
shape: root
|
|
@@ -6778,10 +6731,10 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6778
6731
|
continue;
|
|
6779
6732
|
}
|
|
6780
6733
|
const shape = frame.shape;
|
|
6781
|
-
if (INTRINSICS.apply(INTRINSICS.recall,
|
|
6734
|
+
if (INTRINSICS.apply(INTRINSICS.recall, known, [shape]) !== void 0) continue;
|
|
6782
6735
|
const index = this.#nodes.length;
|
|
6783
6736
|
this.#nodes[index] = shape;
|
|
6784
|
-
INTRINSICS.apply(INTRINSICS.retain,
|
|
6737
|
+
INTRINSICS.apply(INTRINSICS.retain, known, [shape, index]);
|
|
6785
6738
|
this.#stack[this.#stack.length] = {
|
|
6786
6739
|
operation: "exit",
|
|
6787
6740
|
index
|
|
@@ -6837,7 +6790,15 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6837
6790
|
}
|
|
6838
6791
|
}
|
|
6839
6792
|
#locate(shape) {
|
|
6840
|
-
const
|
|
6793
|
+
const known = this.#index;
|
|
6794
|
+
if (known === void 0) throw new ContractError("ContractCompiler: the prepared index is unavailable", {
|
|
6795
|
+
code: "structure",
|
|
6796
|
+
context: {
|
|
6797
|
+
path: [],
|
|
6798
|
+
shape: "contract"
|
|
6799
|
+
}
|
|
6800
|
+
});
|
|
6801
|
+
const index = INTRINSICS.apply(INTRINSICS.recall, known, [shape]);
|
|
6841
6802
|
if (index === void 0) throw new ContractError("ContractCompiler: a structural child is not in the prepared index", {
|
|
6842
6803
|
code: "structure",
|
|
6843
6804
|
context: {
|
|
@@ -6869,7 +6830,7 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6869
6830
|
}
|
|
6870
6831
|
#trackGuard(plan) {
|
|
6871
6832
|
let filled = 0;
|
|
6872
|
-
let memo
|
|
6833
|
+
let memo;
|
|
6873
6834
|
return (value) => {
|
|
6874
6835
|
if (!isObject(value)) return plan(value);
|
|
6875
6836
|
const opened = ContractCompiler.#scope === 0;
|
|
@@ -6879,7 +6840,7 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6879
6840
|
}
|
|
6880
6841
|
try {
|
|
6881
6842
|
const scope = ContractCompiler.#scope;
|
|
6882
|
-
if (filled !== scope) {
|
|
6843
|
+
if (memo === void 0 || filled !== scope) {
|
|
6883
6844
|
memo = new ContractCompiler.#weakMap();
|
|
6884
6845
|
filled = scope;
|
|
6885
6846
|
}
|
|
@@ -6895,7 +6856,7 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6895
6856
|
}
|
|
6896
6857
|
#trackFaults(plan) {
|
|
6897
6858
|
let filled = 0;
|
|
6898
|
-
let memo
|
|
6859
|
+
let memo;
|
|
6899
6860
|
return (value, path) => {
|
|
6900
6861
|
if (!isObject(value)) return plan(value, path);
|
|
6901
6862
|
const opened = ContractCompiler.#scope === 0;
|
|
@@ -6905,7 +6866,7 @@ var ContractCompiler = class ContractCompiler {
|
|
|
6905
6866
|
}
|
|
6906
6867
|
try {
|
|
6907
6868
|
const scope = ContractCompiler.#scope;
|
|
6908
|
-
if (filled !== scope) {
|
|
6869
|
+
if (memo === void 0 || filled !== scope) {
|
|
6909
6870
|
memo = new ContractCompiler.#weakMap();
|
|
6910
6871
|
filled = scope;
|
|
6911
6872
|
}
|
|
@@ -10412,6 +10373,6 @@ function schemaToShape(schema) {
|
|
|
10412
10373
|
}, "schemaToShape");
|
|
10413
10374
|
}
|
|
10414
10375
|
//#endregion
|
|
10415
|
-
export { CLONE_NODE_LIMIT, COMPILE_DEPTH_LIMIT, COMPILE_NODE_LIMIT, ContractCompiler, ContractError, FAULT_LIMIT, FORMAT_MAX_LENGTH, FORMAT_PATTERNS, GENERATION_ATTEMPT_LIMIT, GUARD_DEPTH_LIMIT, INFER_BREADTH_LIMIT, INFER_DEPTH_LIMIT, INFER_ENUM_LIMIT, INTRINSICS, JSONCloner, JSON_SCHEMA_TYPES, PREVIEW_LIMIT, SchemaCloner, ShapeCloner, ShapeValidator, admitMember, admitVisited, andOf, appendEntries, arrayOf, arrayShape, attempt, booleanShape, boundsOf, buildObjectShape, buildSampleMemo, buildShapeFromNode, canonicalStringify, canonicalizeValue, classifyFormat, cloneJSONRecord, cloneJSONValue, cloneSchema, cloneShape, collectEntries, collectMembers, compareValues, compileAuditor, compileGenerator, compileGuard, compileParser, compileReporter, compileSchema, complementOf, contain, createArrayFaults, createContract, createNumberFaults, createStringFaults, deriveLengthBounds, deriveRangeBounds, drawRandom, encodeLeaf, enumOf, enumerableKeys, enumerableSymbolCount, holds, inferArray, inferObject, inferPrimitiveEnum, inferRecordSamples, inferSamples, inferValue, instanceOf, integerShape, intersectionOf, isArray, isArrayBuffer, isArrayBufferView, isAsyncFunction, isAsyncGeneratorFunction, isAsyncIterable, isBigInt, isBigInt64Array, isBigUint64Array, isBoolean, isBoundedJSONRecord, isBoundedJSONValue, isConstructor, isContractError, isDataView, isDate, isDefined, isEmptyArray, isEmptyMap, isEmptyObject, isEmptySet, isEmptyString, isError, isFalse, isFiniteNumber, isFloat32Array, isFloat64Array, isFunction, isGeneratorFunction, isInstance, isInt16Array, isInt32Array, isInt8Array, isInteger, isIterable, isJSONPrimitive, isJSONValue, isLiteralValue, isMap, isNonEmptyArray, isNonEmptyMap, isNonEmptyObject, isNonEmptySet, isNonEmptyString, isNonNegativeInteger, isNonNegativeNumber, isNull, isNullableBoolean, isNullableNumber, isNullableString, isNumber, isObject, isPromise, isPromiseLike, isRecord, isRegExp, isSet, isSharedArrayBuffer, isString, isSymbol, isTrue, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, isValidISOInstant, isWeakMap, isWeakSet, isZeroArg, isZeroArgAsync, isZeroArgAsyncGenerator, isZeroArgGenerator, jsonShape, keyOf, lazyOf, limitEntries, literalOf, literalShape, mapOf, matchOf, matchesJSONDepth, matchesJSONValue, matchesMember, matchesPattern, matchesRecordBrand, matchesVisited, notOf, nullShape, nullableOf, nullableShape, numberShape, objectOf, objectShape, omitOf, omitVisited, oneOfShape, optionalOf, optionalShape, orOf, ownShape, parseArray, parseArrayField, parseBoolean, parseBooleanField, parseEnum, parseEnumField, parseInteger, parseIntegerField, parseJSON, parseJSONAs, parseJSONValue, parseJSONValueField, parseNull, parseNullField, parseNumber, parseNumberField, parseRecord, parseRecordField, parseString, parseStringField, pathOf, pickOf, pinMembers, preview, rawShape, readArrayEntries, readGuardShape, readMapEntries, readOptions, readPattern, readPatternFlags, readPatternSource, readSampleMemo, readSetEntries, readValue, recordOf, recordShape, refuseExpansion, resolveField, retainDepth, samplesToFormat, samplesToSchema, sanitizeBudget, sanitizeDepth, schemaNodeToShape, schemaToObject, schemaToParameters, schemaToShape, seededRandom, selectClosestFaults, setOf, shapeToKind, sortValues, stringOf, stringShape, stringToFormat, transformOf, tupleOf, unifySchemas, unionOf, unionShape, validateShapeDepth, valueToSchema, whereOf };
|
|
10376
|
+
export { CLONE_NODE_LIMIT, COMPILE_DEPTH_LIMIT, COMPILE_NODE_LIMIT, CONTRACT_ERROR_BRAND, ContractCompiler, ContractError, FAULT_LIMIT, FORMAT_MAX_LENGTH, FORMAT_PATTERNS, GENERATION_ATTEMPT_LIMIT, GUARD_DEPTH_LIMIT, INFER_BREADTH_LIMIT, INFER_DEPTH_LIMIT, INFER_ENUM_LIMIT, INTRINSICS, JSONCloner, JSON_SCHEMA_TYPES, PREVIEW_LIMIT, SchemaCloner, ShapeCloner, ShapeValidator, admitMember, admitVisited, andOf, appendEntries, arrayOf, arrayShape, attempt, booleanShape, boundsOf, buildObjectShape, buildSampleMemo, buildShapeFromNode, canonicalStringify, canonicalizeValue, classifyFormat, cloneJSONRecord, cloneJSONValue, cloneSchema, cloneShape, collectEntries, collectMembers, compareValues, compileAuditor, compileGenerator, compileGuard, compileParser, compileReporter, compileSchema, complementOf, contain, createArrayFaults, createContract, createNumberFaults, createStringFaults, deriveLengthBounds, deriveRangeBounds, drawRandom, encodeLeaf, enumOf, enumerableKeys, enumerableSymbolCount, holds, inferArray, inferObject, inferPrimitiveEnum, inferRecordSamples, inferSamples, inferValue, instanceOf, integerShape, intersectionOf, isArray, isArrayBuffer, isArrayBufferView, isAsyncFunction, isAsyncGeneratorFunction, isAsyncIterable, isBigInt, isBigInt64Array, isBigUint64Array, isBoolean, isBoundedJSONRecord, isBoundedJSONValue, isConstructor, isContractError, isDataView, isDate, isDefined, isEmptyArray, isEmptyMap, isEmptyObject, isEmptySet, isEmptyString, isError, isFalse, isFiniteNumber, isFloat32Array, isFloat64Array, isFunction, isGeneratorFunction, isInstance, isInt16Array, isInt32Array, isInt8Array, isInteger, isIterable, isJSONPrimitive, isJSONValue, isLiteralValue, isMap, isNonEmptyArray, isNonEmptyMap, isNonEmptyObject, isNonEmptySet, isNonEmptyString, isNonNegativeInteger, isNonNegativeNumber, isNull, isNullableBoolean, isNullableNumber, isNullableString, isNumber, isObject, isPromise, isPromiseLike, isRecord, isRegExp, isSet, isSharedArrayBuffer, isString, isSymbol, isTrue, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, isValidISOInstant, isWeakMap, isWeakSet, isZeroArg, isZeroArgAsync, isZeroArgAsyncGenerator, isZeroArgGenerator, jsonShape, keyOf, lazyOf, limitEntries, literalOf, literalShape, mapOf, matchOf, matchesJSONDepth, matchesJSONValue, matchesMember, matchesPattern, matchesRecordBrand, matchesVisited, notOf, nullShape, nullableOf, nullableShape, numberShape, objectOf, objectShape, omitOf, omitVisited, oneOfShape, optionalOf, optionalShape, orOf, ownShape, parseArray, parseArrayField, parseBoolean, parseBooleanField, parseEnum, parseEnumField, parseInteger, parseIntegerField, parseJSON, parseJSONAs, parseJSONValue, parseJSONValueField, parseNull, parseNullField, parseNumber, parseNumberField, parseRecord, parseRecordField, parseString, parseStringField, pathOf, pickOf, pinMembers, preview, rawShape, readArrayEntries, readGuardShape, readMapEntries, readOptions, readPattern, readPatternFlags, readPatternSource, readSampleMemo, readSetEntries, readValue, recordOf, recordShape, refuseExpansion, resolveField, retainDepth, samplesToFormat, samplesToSchema, sanitizeBudget, sanitizeDepth, schemaNodeToShape, schemaToObject, schemaToParameters, schemaToShape, seededRandom, selectClosestFaults, setOf, shapeToKind, sortValues, stringOf, stringShape, stringToFormat, transformOf, tupleOf, unifySchemas, unionOf, unionShape, validateShapeDepth, valueToSchema, whereOf };
|
|
10416
10377
|
|
|
10417
10378
|
//# sourceMappingURL=index.js.map
|