@orkestrel/contract 0.0.11 → 0.0.13
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 +145 -126
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +71 -85
- package/dist/src/core/index.d.ts +71 -85
- package/dist/src/core/index.js +143 -127
- package/dist/src/core/index.js.map +1 -1
- package/package.json +14 -11
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
|
|
@@ -2477,6 +2422,61 @@ function readArrayEntries(value) {
|
|
|
2477
2422
|
});
|
|
2478
2423
|
}
|
|
2479
2424
|
/**
|
|
2425
|
+
* Snapshot a guard shape and its optional-key mode for a shape combinator.
|
|
2426
|
+
*
|
|
2427
|
+
* @remarks
|
|
2428
|
+
* A null-prototype record plus its own key list is used instead of a `Map`.
|
|
2429
|
+
* The declared-key population decides the guard's answer, and
|
|
2430
|
+
* `Map.prototype.has`, `Map.prototype.get`, and map iteration are three
|
|
2431
|
+
* caller-writable members on that path. An own data key read by index
|
|
2432
|
+
* dispatches through nothing.
|
|
2433
|
+
*
|
|
2434
|
+
* @param shape - The guard shape whose own string declarations to snapshot
|
|
2435
|
+
* @param optional - The optional-key list, `true` for every key, or `undefined`
|
|
2436
|
+
* @param reader - The public combinator name used in read refusals
|
|
2437
|
+
* @returns The owned guards and names plus the collected optional-key membership
|
|
2438
|
+
* @throws {ContractError} When the shape or optional-key list cannot be read
|
|
2439
|
+
*
|
|
2440
|
+
* @example
|
|
2441
|
+
* ```ts
|
|
2442
|
+
* readGuardShape({ id: isString }, undefined, 'recordOf')
|
|
2443
|
+
* ```
|
|
2444
|
+
*/
|
|
2445
|
+
function readGuardShape(shape, optional, reader) {
|
|
2446
|
+
const declared = readValue(() => {
|
|
2447
|
+
const members = INTRINSICS.members(shape);
|
|
2448
|
+
const guards = INTRINSICS.create(null);
|
|
2449
|
+
const names = [];
|
|
2450
|
+
for (let index = 0; index < members.length; index += 1) {
|
|
2451
|
+
const key = members[index];
|
|
2452
|
+
if (!isString(key)) continue;
|
|
2453
|
+
if (!INTRINSICS.own(guards, key)) names[names.length] = key;
|
|
2454
|
+
guards[key] = shape[key];
|
|
2455
|
+
}
|
|
2456
|
+
return {
|
|
2457
|
+
guards,
|
|
2458
|
+
names,
|
|
2459
|
+
vocabulary: collectMembers(names)
|
|
2460
|
+
};
|
|
2461
|
+
}, reader, { subject: "shape" });
|
|
2462
|
+
const optionalKeys = readValue(() => {
|
|
2463
|
+
if (optional === true) return collectMembers(declared.names);
|
|
2464
|
+
if (!INTRINSICS.array(optional)) return collectMembers([]);
|
|
2465
|
+
const entries = readArrayEntries(optional);
|
|
2466
|
+
if (!entries.success) throw entries.error;
|
|
2467
|
+
if (!entries.value.dense) throw new INTRINSICS.error("Optional key list must be dense");
|
|
2468
|
+
const keys = collectMembers([]);
|
|
2469
|
+
for (let index = 0; index < entries.value.entries.length; index += 1) admitMember(keys, INTRINSICS.text(entries.value.entries[index]));
|
|
2470
|
+
return keys;
|
|
2471
|
+
}, reader, { subject: "optional" });
|
|
2472
|
+
return {
|
|
2473
|
+
guards: declared.guards,
|
|
2474
|
+
names: declared.names,
|
|
2475
|
+
optional: optionalKeys,
|
|
2476
|
+
vocabulary: declared.vocabulary
|
|
2477
|
+
};
|
|
2478
|
+
}
|
|
2479
|
+
/**
|
|
2480
2480
|
* Snapshot an object's own enumerable string keys through a total boundary.
|
|
2481
2481
|
*
|
|
2482
2482
|
* @remarks
|
|
@@ -5703,32 +5703,7 @@ function mapOf(keyGuard, valueGuard) {
|
|
|
5703
5703
|
*/
|
|
5704
5704
|
function recordOf(shape, optional) {
|
|
5705
5705
|
return contain(() => {
|
|
5706
|
-
const declared =
|
|
5707
|
-
const members = INTRINSICS.members(shape);
|
|
5708
|
-
const collected = INTRINSICS.create(null);
|
|
5709
|
-
const names = [];
|
|
5710
|
-
for (let index = 0; index < members.length; index += 1) {
|
|
5711
|
-
const key = members[index];
|
|
5712
|
-
if (!isString(key)) continue;
|
|
5713
|
-
if (!INTRINSICS.own(collected, key)) names[names.length] = key;
|
|
5714
|
-
collected[key] = shape[key];
|
|
5715
|
-
}
|
|
5716
|
-
return {
|
|
5717
|
-
collected,
|
|
5718
|
-
names,
|
|
5719
|
-
vocabulary: collectMembers(names)
|
|
5720
|
-
};
|
|
5721
|
-
}, "recordOf", { subject: "shape" });
|
|
5722
|
-
const optionalKeys = readValue(() => {
|
|
5723
|
-
if (optional === true) return collectMembers(declared.names);
|
|
5724
|
-
if (!INTRINSICS.array(optional)) return collectMembers([]);
|
|
5725
|
-
const entries = readArrayEntries(optional);
|
|
5726
|
-
if (!entries.success) throw entries.error;
|
|
5727
|
-
if (!entries.value.dense) throw new INTRINSICS.error("Optional key list must be dense");
|
|
5728
|
-
const keys = collectMembers([]);
|
|
5729
|
-
for (let index = 0; index < entries.value.entries.length; index += 1) admitMember(keys, INTRINSICS.text(entries.value.entries[index]));
|
|
5730
|
-
return keys;
|
|
5731
|
-
}, "recordOf", { subject: "optional" });
|
|
5706
|
+
const declared = readGuardShape(shape, optional, "recordOf");
|
|
5732
5707
|
return (value) => holds(() => {
|
|
5733
5708
|
if (!isRecord(value)) return false;
|
|
5734
5709
|
const members = INTRINSICS.members(value);
|
|
@@ -5739,9 +5714,9 @@ function recordOf(shape, optional) {
|
|
|
5739
5714
|
for (let index = 0; index < declared.names.length; index += 1) {
|
|
5740
5715
|
const key = declared.names[index];
|
|
5741
5716
|
if (key === void 0) continue;
|
|
5742
|
-
const guard = declared.
|
|
5717
|
+
const guard = declared.guards[key];
|
|
5743
5718
|
const present = INTRINSICS.own(value, key);
|
|
5744
|
-
if (!matchesMember(
|
|
5719
|
+
if (!matchesMember(declared.optional, key) && !present) return false;
|
|
5745
5720
|
if (present) {
|
|
5746
5721
|
if (guard === void 0 || !guard(value[key])) return false;
|
|
5747
5722
|
}
|
|
@@ -5751,6 +5726,47 @@ function recordOf(shape, optional) {
|
|
|
5751
5726
|
}, "recordOf");
|
|
5752
5727
|
}
|
|
5753
5728
|
/**
|
|
5729
|
+
* Build a guard that accepts non-array objects matching an open guard shape.
|
|
5730
|
+
*
|
|
5731
|
+
* @remarks
|
|
5732
|
+
* Three calling modes mirror {@link recordOf}:
|
|
5733
|
+
* - **No `optional`** — all shape keys required; unknown members admitted.
|
|
5734
|
+
* - **`optional: K[]`** — the listed keys are optional; all others required.
|
|
5735
|
+
* - **`optional: true`** — every shape key is optional.
|
|
5736
|
+
*
|
|
5737
|
+
* Each declared member is read through `Reflect.get`, so inherited data and
|
|
5738
|
+
* prototype accessors can satisfy the shape. An optional member passes when its
|
|
5739
|
+
* read value is `undefined`; otherwise its guard must accept the value. Unknown
|
|
5740
|
+
* members are never enumerated or inspected. Member-carrying functions are
|
|
5741
|
+
* accepted. Arrays, `null`, and primitives are rejected. Hostile reads return
|
|
5742
|
+
* `false` rather than throwing.
|
|
5743
|
+
*
|
|
5744
|
+
* @example
|
|
5745
|
+
* ```ts
|
|
5746
|
+
* const isResult = objectOf({ conclusion: isBoolean })
|
|
5747
|
+
* isResult({ conclusion: true, metadata: 'retained' }) // true
|
|
5748
|
+
* isResult([]) // false
|
|
5749
|
+
* ```
|
|
5750
|
+
*/
|
|
5751
|
+
function objectOf(shape, optional) {
|
|
5752
|
+
return contain(() => {
|
|
5753
|
+
const declared = readGuardShape(shape, optional, "objectOf");
|
|
5754
|
+
return (value) => holds(() => {
|
|
5755
|
+
if (!isObject(value) && !isFunction(value) || INTRINSICS.array(value)) return false;
|
|
5756
|
+
for (let index = 0; index < declared.names.length; index += 1) {
|
|
5757
|
+
const key = declared.names[index];
|
|
5758
|
+
if (key === void 0) continue;
|
|
5759
|
+
const guard = declared.guards[key];
|
|
5760
|
+
const member = INTRINSICS.read(value, key);
|
|
5761
|
+
if (matchesMember(declared.optional, key)) {
|
|
5762
|
+
if (member !== void 0 && (guard === void 0 || !guard(member))) return false;
|
|
5763
|
+
} else if (guard === void 0 || !guard(member)) return false;
|
|
5764
|
+
}
|
|
5765
|
+
return true;
|
|
5766
|
+
});
|
|
5767
|
+
}, "objectOf");
|
|
5768
|
+
}
|
|
5769
|
+
/**
|
|
5754
5770
|
* Build a guard that accepts values that are own keys of the provided object.
|
|
5755
5771
|
*
|
|
5756
5772
|
* @remarks
|
|
@@ -10341,6 +10357,6 @@ function schemaToShape(schema) {
|
|
|
10341
10357
|
}, "schemaToShape");
|
|
10342
10358
|
}
|
|
10343
10359
|
//#endregion
|
|
10344
|
-
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, 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, 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 };
|
|
10360
|
+
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 };
|
|
10345
10361
|
|
|
10346
10362
|
//# sourceMappingURL=index.js.map
|