@sinclair/typebox 0.29.5 → 0.30.0-dev-1
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/compiler/compiler.d.ts +7 -4
- package/compiler/compiler.js +208 -194
- package/errors/errors.d.ts +65 -60
- package/errors/errors.js +515 -492
- package/package.json +14 -2
- package/readme.md +161 -169
- package/system/system.js +0 -6
- package/typebox.d.ts +99 -52
- package/typebox.js +496 -573
- package/value/cast.d.ts +5 -4
- package/value/cast.js +255 -260
- package/value/check.d.ts +4 -3
- package/value/check.js +412 -397
- package/value/clone.d.ts +2 -3
- package/value/clone.js +62 -42
- package/value/convert.d.ts +5 -4
- package/value/convert.js +305 -318
- package/value/create.d.ts +6 -6
- package/value/create.js +388 -376
- package/value/delta.d.ts +2 -4
- package/value/delta.js +121 -130
- package/value/equal.d.ts +2 -3
- package/value/equal.js +48 -51
- package/value/guard.d.ts +44 -0
- package/value/guard.js +146 -0
- package/value/hash.d.ts +14 -3
- package/value/hash.js +124 -166
- package/value/index.d.ts +3 -4
- package/value/index.js +6 -20
- package/value/mutate.d.ts +2 -4
- package/value/mutate.js +75 -67
- package/value/pointer.js +8 -2
- package/value/value.d.ts +15 -15
- package/value/value.js +27 -27
- package/value/is.d.ts +0 -11
- package/value/is.js +0 -53
package/errors/errors.d.ts
CHANGED
|
@@ -3,62 +3,67 @@ export declare enum ValueErrorType {
|
|
|
3
3
|
Array = 0,
|
|
4
4
|
ArrayMinItems = 1,
|
|
5
5
|
ArrayMaxItems = 2,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
6
|
+
ArrayContains = 3,
|
|
7
|
+
ArrayMinContains = 4,
|
|
8
|
+
ArrayMaxContains = 5,
|
|
9
|
+
ArrayUniqueItems = 6,
|
|
10
|
+
AsyncIterator = 7,
|
|
11
|
+
BigInt = 8,
|
|
12
|
+
BigIntMultipleOf = 9,
|
|
13
|
+
BigIntExclusiveMinimum = 10,
|
|
14
|
+
BigIntExclusiveMaximum = 11,
|
|
15
|
+
BigIntMinimum = 12,
|
|
16
|
+
BigIntMaximum = 13,
|
|
17
|
+
Boolean = 14,
|
|
18
|
+
Date = 15,
|
|
19
|
+
DateExclusiveMinimumTimestamp = 16,
|
|
20
|
+
DateExclusiveMaximumTimestamp = 17,
|
|
21
|
+
DateMinimumTimestamp = 18,
|
|
22
|
+
DateMaximumTimestamp = 19,
|
|
23
|
+
Function = 20,
|
|
24
|
+
Integer = 21,
|
|
25
|
+
IntegerMultipleOf = 22,
|
|
26
|
+
IntegerExclusiveMinimum = 23,
|
|
27
|
+
IntegerExclusiveMaximum = 24,
|
|
28
|
+
IntegerMinimum = 25,
|
|
29
|
+
IntegerMaximum = 26,
|
|
30
|
+
Intersect = 27,
|
|
31
|
+
IntersectUnevaluatedProperties = 28,
|
|
32
|
+
Iterator = 29,
|
|
33
|
+
Literal = 30,
|
|
34
|
+
Never = 31,
|
|
35
|
+
Not = 32,
|
|
36
|
+
Null = 33,
|
|
37
|
+
Number = 34,
|
|
38
|
+
NumberMultipleOf = 35,
|
|
39
|
+
NumberExclusiveMinimum = 36,
|
|
40
|
+
NumberExclusiveMaximum = 37,
|
|
41
|
+
NumberMinimum = 38,
|
|
42
|
+
NumberMaximum = 39,
|
|
43
|
+
Object = 40,
|
|
44
|
+
ObjectMinProperties = 41,
|
|
45
|
+
ObjectMaxProperties = 42,
|
|
46
|
+
ObjectAdditionalProperties = 43,
|
|
47
|
+
ObjectRequiredProperties = 44,
|
|
48
|
+
Promise = 45,
|
|
49
|
+
RecordKeyNumeric = 46,
|
|
50
|
+
RecordKeyString = 47,
|
|
51
|
+
String = 48,
|
|
52
|
+
StringMinLength = 49,
|
|
53
|
+
StringMaxLength = 50,
|
|
54
|
+
StringPattern = 51,
|
|
55
|
+
StringFormatUnknown = 52,
|
|
56
|
+
StringFormat = 53,
|
|
57
|
+
Symbol = 54,
|
|
58
|
+
TupleZeroLength = 55,
|
|
59
|
+
TupleLength = 56,
|
|
60
|
+
Undefined = 57,
|
|
61
|
+
Union = 58,
|
|
62
|
+
Uint8Array = 59,
|
|
63
|
+
Uint8ArrayMinByteLength = 60,
|
|
64
|
+
Uint8ArrayMaxByteLength = 61,
|
|
65
|
+
Void = 62,
|
|
66
|
+
Kind = 63
|
|
62
67
|
}
|
|
63
68
|
export interface ValueError {
|
|
64
69
|
type: ValueErrorType;
|
|
@@ -82,7 +87,7 @@ export declare class ValueErrorsDereferenceError extends Error {
|
|
|
82
87
|
readonly schema: Types.TRef | Types.TThis;
|
|
83
88
|
constructor(schema: Types.TRef | Types.TThis);
|
|
84
89
|
}
|
|
85
|
-
/**
|
|
86
|
-
export declare
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
/** Returns an iterator for each error in this value. */
|
|
91
|
+
export declare function Errors<T extends Types.TSchema>(schema: T, references: Types.TSchema[], value: unknown): ValueErrorIterator;
|
|
92
|
+
/** Returns an iterator for each error in this value. */
|
|
93
|
+
export declare function Errors<T extends Types.TSchema>(schema: T, value: unknown): ValueErrorIterator;
|