@orkestrel/contract 0.0.3 → 0.0.4
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/combinators.d.ts +2 -2
- package/dist/src/core/index.cjs +123 -36
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.js +123 -37
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/core/shapers.d.ts +20 -4
- package/dist/src/core/types.d.ts +38 -6
- package/dist/src/core/validators.d.ts +57 -2
- package/package.json +2 -2
package/dist/src/core/index.js
CHANGED
|
@@ -62,7 +62,14 @@ function isUndefined(value) {
|
|
|
62
62
|
function isDefined(value) {
|
|
63
63
|
return value !== null && value !== void 0;
|
|
64
64
|
}
|
|
65
|
-
/** Determine whether a value is a string.
|
|
65
|
+
/** Determine whether a value is a string.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* isString('hi') // true
|
|
70
|
+
* isString(42) // false
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
66
73
|
function isString(value) {
|
|
67
74
|
return typeof value === "string";
|
|
68
75
|
}
|
|
@@ -71,11 +78,26 @@ function isString(value) {
|
|
|
71
78
|
*
|
|
72
79
|
* @remarks
|
|
73
80
|
* Includes `NaN` and `±Infinity` — use {@link isFiniteNumber} to exclude them.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* isNumber(42) // true
|
|
85
|
+
* isNumber(Number.NaN) // true — NaN is still a number
|
|
86
|
+
* isNumber('42') // false
|
|
87
|
+
* ```
|
|
74
88
|
*/
|
|
75
89
|
function isNumber(value) {
|
|
76
90
|
return typeof value === "number";
|
|
77
91
|
}
|
|
78
|
-
/** Determine whether a value is a finite number (excludes `NaN` and `±Infinity`).
|
|
92
|
+
/** Determine whether a value is a finite number (excludes `NaN` and `±Infinity`).
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* isFiniteNumber(42) // true
|
|
97
|
+
* isFiniteNumber(Number.NaN) // false
|
|
98
|
+
* isFiniteNumber(Infinity) // false
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
79
101
|
function isFiniteNumber(value) {
|
|
80
102
|
return typeof value === "number" && Number.isFinite(value);
|
|
81
103
|
}
|
|
@@ -192,6 +214,35 @@ function isNullableNumber(value) {
|
|
|
192
214
|
function isNullableBoolean(value) {
|
|
193
215
|
return value === null || isBoolean(value);
|
|
194
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Determine whether a value is an instance of a constructor, contained against
|
|
219
|
+
* a throwing `instanceof` check.
|
|
220
|
+
*
|
|
221
|
+
* @remarks
|
|
222
|
+
* The low-level total helper every `instanceof`-based guard in this file (and
|
|
223
|
+
* the `instanceOf` combinator) routes through. A bare `value instanceof X` is
|
|
224
|
+
* NOT total (AGENTS §14): it invokes `getPrototypeOf` on `value` — which a
|
|
225
|
+
* revoked `Proxy` or a `getPrototypeOf`-trap `Proxy` throws from — and, when
|
|
226
|
+
* `X[Symbol.hasInstance]` is user-defined, can throw from arbitrary code. This
|
|
227
|
+
* wraps the check in {@link attempt} (see ./helpers.js) so any such throw
|
|
228
|
+
* yields `false` instead of escaping.
|
|
229
|
+
*
|
|
230
|
+
* @param value - The value to test
|
|
231
|
+
* @param ctor - The constructor to test against
|
|
232
|
+
* @returns `true` when `value instanceof ctor`, `false` on a non-match or a
|
|
233
|
+
* contained throw
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* isInstance(new Date(), Date) // true
|
|
238
|
+
* isInstance({}, Date) // false
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
function isInstance(value, ctor) {
|
|
242
|
+
const target = ctor;
|
|
243
|
+
const outcome = attempt(() => isFunction(target) && value instanceof target);
|
|
244
|
+
return outcome.success && outcome.value;
|
|
245
|
+
}
|
|
195
246
|
/** Determine whether a value is a `Date`.
|
|
196
247
|
*
|
|
197
248
|
* @example
|
|
@@ -201,7 +252,7 @@ function isNullableBoolean(value) {
|
|
|
201
252
|
* ```
|
|
202
253
|
*/
|
|
203
254
|
function isDate(value) {
|
|
204
|
-
return value
|
|
255
|
+
return isInstance(value, Date);
|
|
205
256
|
}
|
|
206
257
|
/** Determine whether a value is a `RegExp`.
|
|
207
258
|
*
|
|
@@ -212,7 +263,7 @@ function isDate(value) {
|
|
|
212
263
|
* ```
|
|
213
264
|
*/
|
|
214
265
|
function isRegExp(value) {
|
|
215
|
-
return value
|
|
266
|
+
return isInstance(value, RegExp);
|
|
216
267
|
}
|
|
217
268
|
/** Determine whether a value is an `Error`.
|
|
218
269
|
*
|
|
@@ -223,7 +274,7 @@ function isRegExp(value) {
|
|
|
223
274
|
* ```
|
|
224
275
|
*/
|
|
225
276
|
function isError(value) {
|
|
226
|
-
return value
|
|
277
|
+
return isInstance(value, Error);
|
|
227
278
|
}
|
|
228
279
|
/** Determine whether a value is a native `Promise` (use {@link isPromiseLike} for any thenable).
|
|
229
280
|
*
|
|
@@ -234,7 +285,7 @@ function isError(value) {
|
|
|
234
285
|
* ```
|
|
235
286
|
*/
|
|
236
287
|
function isPromise(value) {
|
|
237
|
-
return value
|
|
288
|
+
return isInstance(value, Promise);
|
|
238
289
|
}
|
|
239
290
|
/**
|
|
240
291
|
* Determine whether a value is promise-like — an object exposing callable
|
|
@@ -270,7 +321,7 @@ function isPromiseLike(value) {
|
|
|
270
321
|
* ```
|
|
271
322
|
*/
|
|
272
323
|
function isArrayBuffer(value) {
|
|
273
|
-
return value
|
|
324
|
+
return isInstance(value, ArrayBuffer);
|
|
274
325
|
}
|
|
275
326
|
/**
|
|
276
327
|
* Determine whether a value is a `SharedArrayBuffer`.
|
|
@@ -286,7 +337,7 @@ function isArrayBuffer(value) {
|
|
|
286
337
|
* ```
|
|
287
338
|
*/
|
|
288
339
|
function isSharedArrayBuffer(value) {
|
|
289
|
-
return typeof SharedArrayBuffer !== "undefined" && value
|
|
340
|
+
return typeof SharedArrayBuffer !== "undefined" && isInstance(value, SharedArrayBuffer);
|
|
290
341
|
}
|
|
291
342
|
/**
|
|
292
343
|
* Determine whether a value implements the iterable protocol (`Symbol.iterator`).
|
|
@@ -355,6 +406,14 @@ function isObject(value) {
|
|
|
355
406
|
* instance's runs through the class's own prototype. The whole body runs
|
|
356
407
|
* inside `attempt` (AGENTS §14) so a revoked `Proxy` or a hostile
|
|
357
408
|
* `getPrototypeOf` trap cannot escape as a thrown error.
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* ```ts
|
|
412
|
+
* isRecord({ a: 1 }) // true
|
|
413
|
+
* isRecord(Object.create(null)) // true
|
|
414
|
+
* isRecord([]) // false
|
|
415
|
+
* isRecord(new Date()) // false
|
|
416
|
+
* ```
|
|
358
417
|
*/
|
|
359
418
|
function isRecord(value) {
|
|
360
419
|
const outcome = attempt(() => {
|
|
@@ -373,7 +432,7 @@ function isRecord(value) {
|
|
|
373
432
|
* ```
|
|
374
433
|
*/
|
|
375
434
|
function isMap(value) {
|
|
376
|
-
return value
|
|
435
|
+
return isInstance(value, Map);
|
|
377
436
|
}
|
|
378
437
|
/** Determine whether a value is a `Set`.
|
|
379
438
|
*
|
|
@@ -384,7 +443,7 @@ function isMap(value) {
|
|
|
384
443
|
* ```
|
|
385
444
|
*/
|
|
386
445
|
function isSet(value) {
|
|
387
|
-
return value
|
|
446
|
+
return isInstance(value, Set);
|
|
388
447
|
}
|
|
389
448
|
/** Determine whether a value is a `WeakMap`.
|
|
390
449
|
*
|
|
@@ -395,7 +454,7 @@ function isSet(value) {
|
|
|
395
454
|
* ```
|
|
396
455
|
*/
|
|
397
456
|
function isWeakMap(value) {
|
|
398
|
-
return value
|
|
457
|
+
return isInstance(value, WeakMap);
|
|
399
458
|
}
|
|
400
459
|
/** Determine whether a value is a `WeakSet`.
|
|
401
460
|
*
|
|
@@ -406,7 +465,7 @@ function isWeakMap(value) {
|
|
|
406
465
|
* ```
|
|
407
466
|
*/
|
|
408
467
|
function isWeakSet(value) {
|
|
409
|
-
return value
|
|
468
|
+
return isInstance(value, WeakSet);
|
|
410
469
|
}
|
|
411
470
|
/** Determine whether a value is an array.
|
|
412
471
|
*
|
|
@@ -428,7 +487,7 @@ function isArray(value) {
|
|
|
428
487
|
* ```
|
|
429
488
|
*/
|
|
430
489
|
function isDataView(value) {
|
|
431
|
-
return value
|
|
490
|
+
return isInstance(value, DataView);
|
|
432
491
|
}
|
|
433
492
|
/** Determine whether a value is an `ArrayBufferView` (any typed array or `DataView`).
|
|
434
493
|
*
|
|
@@ -450,7 +509,7 @@ function isArrayBufferView(value) {
|
|
|
450
509
|
* ```
|
|
451
510
|
*/
|
|
452
511
|
function isInt8Array(value) {
|
|
453
|
-
return value
|
|
512
|
+
return isInstance(value, Int8Array);
|
|
454
513
|
}
|
|
455
514
|
/** Determine whether a value is a `Uint8Array`.
|
|
456
515
|
*
|
|
@@ -461,7 +520,7 @@ function isInt8Array(value) {
|
|
|
461
520
|
* ```
|
|
462
521
|
*/
|
|
463
522
|
function isUint8Array(value) {
|
|
464
|
-
return value
|
|
523
|
+
return isInstance(value, Uint8Array);
|
|
465
524
|
}
|
|
466
525
|
/** Determine whether a value is a `Uint8ClampedArray`.
|
|
467
526
|
*
|
|
@@ -472,7 +531,7 @@ function isUint8Array(value) {
|
|
|
472
531
|
* ```
|
|
473
532
|
*/
|
|
474
533
|
function isUint8ClampedArray(value) {
|
|
475
|
-
return value
|
|
534
|
+
return isInstance(value, Uint8ClampedArray);
|
|
476
535
|
}
|
|
477
536
|
/** Determine whether a value is an `Int16Array`.
|
|
478
537
|
*
|
|
@@ -483,7 +542,7 @@ function isUint8ClampedArray(value) {
|
|
|
483
542
|
* ```
|
|
484
543
|
*/
|
|
485
544
|
function isInt16Array(value) {
|
|
486
|
-
return value
|
|
545
|
+
return isInstance(value, Int16Array);
|
|
487
546
|
}
|
|
488
547
|
/** Determine whether a value is a `Uint16Array`.
|
|
489
548
|
*
|
|
@@ -494,7 +553,7 @@ function isInt16Array(value) {
|
|
|
494
553
|
* ```
|
|
495
554
|
*/
|
|
496
555
|
function isUint16Array(value) {
|
|
497
|
-
return value
|
|
556
|
+
return isInstance(value, Uint16Array);
|
|
498
557
|
}
|
|
499
558
|
/** Determine whether a value is an `Int32Array`.
|
|
500
559
|
*
|
|
@@ -505,7 +564,7 @@ function isUint16Array(value) {
|
|
|
505
564
|
* ```
|
|
506
565
|
*/
|
|
507
566
|
function isInt32Array(value) {
|
|
508
|
-
return value
|
|
567
|
+
return isInstance(value, Int32Array);
|
|
509
568
|
}
|
|
510
569
|
/** Determine whether a value is a `Uint32Array`.
|
|
511
570
|
*
|
|
@@ -516,7 +575,7 @@ function isInt32Array(value) {
|
|
|
516
575
|
* ```
|
|
517
576
|
*/
|
|
518
577
|
function isUint32Array(value) {
|
|
519
|
-
return value
|
|
578
|
+
return isInstance(value, Uint32Array);
|
|
520
579
|
}
|
|
521
580
|
/** Determine whether a value is a `Float32Array`.
|
|
522
581
|
*
|
|
@@ -527,7 +586,7 @@ function isUint32Array(value) {
|
|
|
527
586
|
* ```
|
|
528
587
|
*/
|
|
529
588
|
function isFloat32Array(value) {
|
|
530
|
-
return value
|
|
589
|
+
return isInstance(value, Float32Array);
|
|
531
590
|
}
|
|
532
591
|
/** Determine whether a value is a `Float64Array`.
|
|
533
592
|
*
|
|
@@ -538,7 +597,7 @@ function isFloat32Array(value) {
|
|
|
538
597
|
* ```
|
|
539
598
|
*/
|
|
540
599
|
function isFloat64Array(value) {
|
|
541
|
-
return value
|
|
600
|
+
return isInstance(value, Float64Array);
|
|
542
601
|
}
|
|
543
602
|
/**
|
|
544
603
|
* Determine whether a value is a `BigInt64Array`.
|
|
@@ -554,7 +613,7 @@ function isFloat64Array(value) {
|
|
|
554
613
|
* ```
|
|
555
614
|
*/
|
|
556
615
|
function isBigInt64Array(value) {
|
|
557
|
-
return typeof BigInt64Array !== "undefined" && value
|
|
616
|
+
return typeof BigInt64Array !== "undefined" && isInstance(value, BigInt64Array);
|
|
558
617
|
}
|
|
559
618
|
/**
|
|
560
619
|
* Determine whether a value is a `BigUint64Array`.
|
|
@@ -570,7 +629,7 @@ function isBigInt64Array(value) {
|
|
|
570
629
|
* ```
|
|
571
630
|
*/
|
|
572
631
|
function isBigUint64Array(value) {
|
|
573
|
-
return typeof BigUint64Array !== "undefined" && value
|
|
632
|
+
return typeof BigUint64Array !== "undefined" && isInstance(value, BigUint64Array);
|
|
574
633
|
}
|
|
575
634
|
/** Determine whether a value is the empty string `''`.
|
|
576
635
|
*
|
|
@@ -604,7 +663,8 @@ function isEmptyArray(value) {
|
|
|
604
663
|
*/
|
|
605
664
|
function isEmptyObject(value) {
|
|
606
665
|
if (!isRecord(value)) return false;
|
|
607
|
-
|
|
666
|
+
const outcome = attempt(() => Object.keys(value).length === 0 && enumerableSymbolCount(value) === 0);
|
|
667
|
+
return outcome.success && outcome.value;
|
|
608
668
|
}
|
|
609
669
|
/** Determine whether a value is an empty `Map`.
|
|
610
670
|
*
|
|
@@ -615,7 +675,7 @@ function isEmptyObject(value) {
|
|
|
615
675
|
* ```
|
|
616
676
|
*/
|
|
617
677
|
function isEmptyMap(value) {
|
|
618
|
-
return value
|
|
678
|
+
return isMap(value) && value.size === 0;
|
|
619
679
|
}
|
|
620
680
|
/** Determine whether a value is an empty `Set`.
|
|
621
681
|
*
|
|
@@ -626,7 +686,7 @@ function isEmptyMap(value) {
|
|
|
626
686
|
* ```
|
|
627
687
|
*/
|
|
628
688
|
function isEmptySet(value) {
|
|
629
|
-
return value
|
|
689
|
+
return isSet(value) && value.size === 0;
|
|
630
690
|
}
|
|
631
691
|
/** Determine whether a value is a non-empty string (at least one character).
|
|
632
692
|
*
|
|
@@ -660,7 +720,8 @@ function isNonEmptyArray(value) {
|
|
|
660
720
|
*/
|
|
661
721
|
function isNonEmptyObject(value) {
|
|
662
722
|
if (!isRecord(value)) return false;
|
|
663
|
-
|
|
723
|
+
const outcome = attempt(() => Object.keys(value).length > 0 || enumerableSymbolCount(value) > 0);
|
|
724
|
+
return outcome.success && outcome.value;
|
|
664
725
|
}
|
|
665
726
|
/** Determine whether a value is a non-empty `Map` (at least one entry).
|
|
666
727
|
*
|
|
@@ -671,7 +732,7 @@ function isNonEmptyObject(value) {
|
|
|
671
732
|
* ```
|
|
672
733
|
*/
|
|
673
734
|
function isNonEmptyMap(value) {
|
|
674
|
-
return value
|
|
735
|
+
return isMap(value) && value.size > 0;
|
|
675
736
|
}
|
|
676
737
|
/** Determine whether a value is a non-empty `Set` (at least one element).
|
|
677
738
|
*
|
|
@@ -682,7 +743,7 @@ function isNonEmptyMap(value) {
|
|
|
682
743
|
* ```
|
|
683
744
|
*/
|
|
684
745
|
function isNonEmptySet(value) {
|
|
685
|
-
return value
|
|
746
|
+
return isSet(value) && value.size > 0;
|
|
686
747
|
}
|
|
687
748
|
/** Determine whether a value is a function that declares zero parameters (`Function.length === 0`).
|
|
688
749
|
*
|
|
@@ -1070,7 +1131,7 @@ function literalOf(...literals) {
|
|
|
1070
1131
|
* ```
|
|
1071
1132
|
*/
|
|
1072
1133
|
function instanceOf(ctor) {
|
|
1073
|
-
return (value) => isConstructor(ctor) && isObject(value) && value
|
|
1134
|
+
return (value) => isConstructor(ctor) && isObject(value) && isInstance(value, ctor);
|
|
1074
1135
|
}
|
|
1075
1136
|
/**
|
|
1076
1137
|
* Build a guard from a native `enum` or any object whose values are strings or
|
|
@@ -1985,7 +2046,11 @@ function compileGuard(shape) {
|
|
|
1985
2046
|
return outcome.success && outcome.value;
|
|
1986
2047
|
};
|
|
1987
2048
|
}
|
|
1988
|
-
case "union":
|
|
2049
|
+
case "union": {
|
|
2050
|
+
const guards = shape.variants.map((variant) => compileGuard(variant));
|
|
2051
|
+
if (shape.mode === "oneOf") return (value) => guards.filter((guard) => guard(value)).length === 1;
|
|
2052
|
+
return unionOf(...guards);
|
|
2053
|
+
}
|
|
1989
2054
|
case "optional": return orOf(isUndefined, compileGuard(shape.inner));
|
|
1990
2055
|
case "nullable": return nullableOf(compileGuard(shape.inner));
|
|
1991
2056
|
case "raw": return (_value) => true;
|
|
@@ -2092,6 +2157,11 @@ function compileParser(shape) {
|
|
|
2092
2157
|
parse: compileParser(variant),
|
|
2093
2158
|
guard: compileGuard(variant)
|
|
2094
2159
|
}));
|
|
2160
|
+
if (shape.mode === "oneOf") return (value) => {
|
|
2161
|
+
const matches = variants.filter((variant) => variant.guard(value));
|
|
2162
|
+
const [only] = matches;
|
|
2163
|
+
return matches.length === 1 && only !== void 0 ? only.parse(value) : void 0;
|
|
2164
|
+
};
|
|
2095
2165
|
return (value) => {
|
|
2096
2166
|
for (const variant of variants) if (variant.guard(value)) return value;
|
|
2097
2167
|
for (const variant of variants) {
|
|
@@ -2415,16 +2485,32 @@ function unionShape(...variants) {
|
|
|
2415
2485
|
* Build a {@link UnionShape} that emits `oneOf` (exactly one match) in JSON Schema.
|
|
2416
2486
|
*
|
|
2417
2487
|
* @remarks
|
|
2418
|
-
*
|
|
2419
|
-
*
|
|
2488
|
+
* Unlike {@link unionShape} (`anyOf` — at least one variant matches),
|
|
2489
|
+
* `oneOfShape`'s compiled guard and parser enforce EXACTLY one match:
|
|
2490
|
+
*
|
|
2491
|
+
* - **Guard**: accepts the value only when exactly one variant's guard
|
|
2492
|
+
* accepts it. A value matching two-or-more variants — which would violate
|
|
2493
|
+
* the emitted `oneOf` schema — is rejected, even though it would pass
|
|
2494
|
+
* {@link unionShape}'s guard.
|
|
2495
|
+
* - **Parser**: judged on the RAW input's guard matches only, with NO
|
|
2496
|
+
* coercion fallback for an ambiguous input. When exactly one variant's
|
|
2497
|
+
* guard accepts the raw value, that variant's parser runs. Zero matches or
|
|
2498
|
+
* two-or-more matches both parse to `undefined` — a value ambiguous
|
|
2499
|
+
* between variants has no well-defined coercion target.
|
|
2500
|
+
*
|
|
2501
|
+
* Prefer {@link unionShape} when a value may legitimately satisfy more than
|
|
2502
|
+
* one variant (e.g. overlapping shapes) and any match is acceptable. Prefer
|
|
2503
|
+
* `oneOfShape` when overlap between variants indicates malformed input that
|
|
2504
|
+
* must be rejected.
|
|
2420
2505
|
*
|
|
2421
2506
|
* @param variants - The candidate shapes
|
|
2422
2507
|
* @returns A union shape with `mode: 'oneOf'`
|
|
2423
2508
|
*
|
|
2424
2509
|
* @example
|
|
2425
2510
|
* ```ts
|
|
2426
|
-
* const id = oneOfShape(
|
|
2427
|
-
* //
|
|
2511
|
+
* const id = oneOfShape(numberShape(), integerShape())
|
|
2512
|
+
* // 3 fails — matches both numberShape and integerShape
|
|
2513
|
+
* // 3.5 passes — matches numberShape only
|
|
2428
2514
|
* ```
|
|
2429
2515
|
*/
|
|
2430
2516
|
function oneOfShape(...variants) {
|
|
@@ -2512,6 +2598,6 @@ function rawShape(schema) {
|
|
|
2512
2598
|
};
|
|
2513
2599
|
}
|
|
2514
2600
|
//#endregion
|
|
2515
|
-
export { JSON_SCHEMA_TYPES, andOf, arrayOf, arrayShape, attempt, booleanShape, boundsOf, compileGenerator, compileGuard, compileParser, compileSchema, complementOf, createContract, enumOf, enumerableSymbolCount, instanceOf, integerShape, intersectionOf, isArray, isArrayBuffer, isArrayBufferView, isAsyncFunction, isAsyncGeneratorFunction, isAsyncIterable, isBigInt, isBigInt64Array, isBigUint64Array, isBoolean, isConstructor, isDataView, isDate, isDefined, isEmptyArray, isEmptyMap, isEmptyObject, isEmptySet, isEmptyString, isError, isFalse, isFiniteNumber, isFloat32Array, isFloat64Array, isFunction, isGeneratorFunction, isInt16Array, isInt32Array, isInt8Array, isInteger, isIterable, isJSONPrimitive, isJSONValue, isMap, isNonEmptyArray, isNonEmptyMap, isNonEmptyObject, isNonEmptySet, isNonEmptyString, isNull, isNullableBoolean, isNullableNumber, isNullableString, isNumber, isObject, isPromise, isPromiseLike, isRecord, isRegExp, isSet, isSharedArrayBuffer, isString, isSymbol, isTrue, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, isWeakMap, isWeakSet, isZeroArg, isZeroArgAsync, isZeroArgAsyncGenerator, isZeroArgGenerator, iterableOf, jsonShape, keyOf, lazyOf, literalOf, literalShape, mapOf, matchOf, notOf, nullShape, nullableOf, nullableShape, numberShape, objectShape, omitOf, oneOfShape, optionalOf, optionalShape, orOf, parseArray, parseArrayField, parseBoolean, parseBooleanField, parseEnum, parseEnumField, parseInteger, parseIntegerField, parseJSON, parseJSONAs, parseJSONValue, parseJSONValueField, parseNull, parseNullField, parseNumber, parseNumberField, parseRecord, parseRecordField, parseString, parseStringField, pickOf, rawShape, recordOf, recordShape, resolveField, schemaToParameters, seededRandom, setOf, stringOf, stringShape, transformOf, tupleOf, unionOf, unionShape, validateShape, whereOf };
|
|
2601
|
+
export { JSON_SCHEMA_TYPES, andOf, arrayOf, arrayShape, attempt, booleanShape, boundsOf, compileGenerator, compileGuard, compileParser, compileSchema, complementOf, createContract, enumOf, enumerableSymbolCount, instanceOf, integerShape, intersectionOf, isArray, isArrayBuffer, isArrayBufferView, isAsyncFunction, isAsyncGeneratorFunction, isAsyncIterable, isBigInt, isBigInt64Array, isBigUint64Array, isBoolean, isConstructor, isDataView, isDate, isDefined, isEmptyArray, isEmptyMap, isEmptyObject, isEmptySet, isEmptyString, isError, isFalse, isFiniteNumber, isFloat32Array, isFloat64Array, isFunction, isGeneratorFunction, isInstance, isInt16Array, isInt32Array, isInt8Array, isInteger, isIterable, isJSONPrimitive, isJSONValue, isMap, isNonEmptyArray, isNonEmptyMap, isNonEmptyObject, isNonEmptySet, isNonEmptyString, isNull, isNullableBoolean, isNullableNumber, isNullableString, isNumber, isObject, isPromise, isPromiseLike, isRecord, isRegExp, isSet, isSharedArrayBuffer, isString, isSymbol, isTrue, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, isWeakMap, isWeakSet, isZeroArg, isZeroArgAsync, isZeroArgAsyncGenerator, isZeroArgGenerator, iterableOf, jsonShape, keyOf, lazyOf, literalOf, literalShape, mapOf, matchOf, notOf, nullShape, nullableOf, nullableShape, numberShape, objectShape, omitOf, oneOfShape, optionalOf, optionalShape, orOf, parseArray, parseArrayField, parseBoolean, parseBooleanField, parseEnum, parseEnumField, parseInteger, parseIntegerField, parseJSON, parseJSONAs, parseJSONValue, parseJSONValueField, parseNull, parseNullField, parseNumber, parseNumberField, parseRecord, parseRecordField, parseString, parseStringField, pickOf, rawShape, recordOf, recordShape, resolveField, schemaToParameters, seededRandom, setOf, stringOf, stringShape, transformOf, tupleOf, unionOf, unionShape, validateShape, whereOf };
|
|
2516
2602
|
|
|
2517
2603
|
//# sourceMappingURL=index.js.map
|