@sinclair/typebox 0.32.32 → 0.32.33
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/build/esm/compiler/compiler.mjs +0 -7
- package/build/esm/errors/errors.mjs +0 -2
- package/build/esm/type/transform/transform.mjs +0 -3
- package/build/esm/value/cast/cast.mjs +0 -1
- package/build/esm/value/check/check.mjs +0 -1
- package/build/esm/value/create/create.mjs +0 -1
- package/build/esm/value/delta/delta.mjs +0 -2
- package/build/esm/value/deref/deref.mjs +0 -1
- package/build/esm/value/hash/hash.mjs +0 -1
- package/build/esm/value/pointer/pointer.mjs +0 -5
- package/build/esm/value/transform/decode.mjs +0 -7
- package/build/esm/value/transform/encode.mjs +0 -7
- package/package.json +1 -1
|
@@ -21,11 +21,6 @@ import { IsSchema } from '../type/guard/type.mjs';
|
|
|
21
21
|
// TypeCheck
|
|
22
22
|
// ------------------------------------------------------------------
|
|
23
23
|
export class TypeCheck {
|
|
24
|
-
schema;
|
|
25
|
-
references;
|
|
26
|
-
checkFunc;
|
|
27
|
-
code;
|
|
28
|
-
hasTransform;
|
|
29
24
|
constructor(schema, references, checkFunc, code) {
|
|
30
25
|
this.schema = schema;
|
|
31
26
|
this.references = references;
|
|
@@ -144,14 +139,12 @@ var LiteralString;
|
|
|
144
139
|
// Errors
|
|
145
140
|
// ------------------------------------------------------------------
|
|
146
141
|
export class TypeCompilerUnknownTypeError extends TypeBoxError {
|
|
147
|
-
schema;
|
|
148
142
|
constructor(schema) {
|
|
149
143
|
super('Unknown type');
|
|
150
144
|
this.schema = schema;
|
|
151
145
|
}
|
|
152
146
|
}
|
|
153
147
|
export class TypeCompilerTypeGuardError extends TypeBoxError {
|
|
154
|
-
schema;
|
|
155
148
|
constructor(schema) {
|
|
156
149
|
super('Preflight validation check failed to guard for the given schema');
|
|
157
150
|
this.schema = schema;
|
|
@@ -87,7 +87,6 @@ export var ValueErrorType;
|
|
|
87
87
|
// ValueErrors
|
|
88
88
|
// ------------------------------------------------------------------
|
|
89
89
|
export class ValueErrorsUnknownTypeError extends TypeBoxError {
|
|
90
|
-
schema;
|
|
91
90
|
constructor(schema) {
|
|
92
91
|
super('Unknown type');
|
|
93
92
|
this.schema = schema;
|
|
@@ -109,7 +108,6 @@ function IsDefined(value) {
|
|
|
109
108
|
// ValueErrorIterator
|
|
110
109
|
// ------------------------------------------------------------------
|
|
111
110
|
export class ValueErrorIterator {
|
|
112
|
-
iterator;
|
|
113
111
|
constructor(iterator) {
|
|
114
112
|
this.iterator = iterator;
|
|
115
113
|
}
|
|
@@ -8,7 +8,6 @@ import { IsTransform } from '../guard/kind.mjs';
|
|
|
8
8
|
// TransformBuilders
|
|
9
9
|
// ------------------------------------------------------------------
|
|
10
10
|
export class TransformDecodeBuilder {
|
|
11
|
-
schema;
|
|
12
11
|
constructor(schema) {
|
|
13
12
|
this.schema = schema;
|
|
14
13
|
}
|
|
@@ -18,8 +17,6 @@ export class TransformDecodeBuilder {
|
|
|
18
17
|
}
|
|
19
18
|
// prettier-ignore
|
|
20
19
|
export class TransformEncodeBuilder {
|
|
21
|
-
schema;
|
|
22
|
-
decode;
|
|
23
20
|
constructor(schema, decode) {
|
|
24
21
|
this.schema = schema;
|
|
25
22
|
this.decode = decode;
|
|
@@ -9,7 +9,6 @@ import { Deref } from '../deref/index.mjs';
|
|
|
9
9
|
// Errors
|
|
10
10
|
// ------------------------------------------------------------------
|
|
11
11
|
export class ValueCastError extends TypeBoxError {
|
|
12
|
-
schema;
|
|
13
12
|
constructor(schema, message) {
|
|
14
13
|
super(message);
|
|
15
14
|
this.schema = schema;
|
|
@@ -19,7 +19,6 @@ import { IsSchema } from '../../type/guard/type.mjs';
|
|
|
19
19
|
// Errors
|
|
20
20
|
// ------------------------------------------------------------------
|
|
21
21
|
export class ValueCheckUnknownTypeError extends TypeBoxError {
|
|
22
|
-
schema;
|
|
23
22
|
constructor(schema) {
|
|
24
23
|
super(`Unknown type`);
|
|
25
24
|
this.schema = schema;
|
|
@@ -11,7 +11,6 @@ import { TypeBoxError } from '../../type/error/index.mjs';
|
|
|
11
11
|
// Errors
|
|
12
12
|
// ------------------------------------------------------------------
|
|
13
13
|
export class ValueCreateError extends TypeBoxError {
|
|
14
|
-
schema;
|
|
15
14
|
constructor(schema, message) {
|
|
16
15
|
super(message);
|
|
17
16
|
this.schema = schema;
|
|
@@ -26,14 +26,12 @@ export const Edit = Union([Insert, Update, Delete]);
|
|
|
26
26
|
// Errors
|
|
27
27
|
// ------------------------------------------------------------------
|
|
28
28
|
export class ValueDeltaError extends TypeBoxError {
|
|
29
|
-
value;
|
|
30
29
|
constructor(value, message) {
|
|
31
30
|
super(message);
|
|
32
31
|
this.value = value;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
export class ValueDeltaSymbolError extends ValueDeltaError {
|
|
36
|
-
value;
|
|
37
35
|
constructor(value) {
|
|
38
36
|
super(value, 'Cannot diff objects with symbol keys');
|
|
39
37
|
this.value = value;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TypeBoxError } from '../../type/error/index.mjs';
|
|
2
2
|
import { Kind } from '../../type/symbols/index.mjs';
|
|
3
3
|
export class TypeDereferenceError extends TypeBoxError {
|
|
4
|
-
schema;
|
|
5
4
|
constructor(schema) {
|
|
6
5
|
super(`Unable to dereference schema with $id '${schema.$id}'`);
|
|
7
6
|
this.schema = schema;
|
|
@@ -4,7 +4,6 @@ import { TypeBoxError } from '../../type/error/index.mjs';
|
|
|
4
4
|
// Errors
|
|
5
5
|
// ------------------------------------------------------------------
|
|
6
6
|
export class ValueHashError extends TypeBoxError {
|
|
7
|
-
value;
|
|
8
7
|
constructor(value) {
|
|
9
8
|
super(`Unable to hash value`);
|
|
10
9
|
this.value = value;
|
|
@@ -3,9 +3,6 @@ import { TypeBoxError } from '../../type/error/index.mjs';
|
|
|
3
3
|
// Errors
|
|
4
4
|
// ------------------------------------------------------------------
|
|
5
5
|
export class ValuePointerRootSetError extends TypeBoxError {
|
|
6
|
-
value;
|
|
7
|
-
path;
|
|
8
|
-
update;
|
|
9
6
|
constructor(value, path, update) {
|
|
10
7
|
super('Cannot set root value');
|
|
11
8
|
this.value = value;
|
|
@@ -14,8 +11,6 @@ export class ValuePointerRootSetError extends TypeBoxError {
|
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
13
|
export class ValuePointerRootDeleteError extends TypeBoxError {
|
|
17
|
-
value;
|
|
18
|
-
path;
|
|
19
14
|
constructor(value, path) {
|
|
20
15
|
super('Cannot delete root value');
|
|
21
16
|
this.value = value;
|
|
@@ -17,9 +17,6 @@ import { IsTransform, IsSchema } from '../../type/guard/type.mjs';
|
|
|
17
17
|
// thrown externally
|
|
18
18
|
// prettier-ignore
|
|
19
19
|
export class TransformDecodeCheckError extends TypeBoxError {
|
|
20
|
-
schema;
|
|
21
|
-
value;
|
|
22
|
-
error;
|
|
23
20
|
constructor(schema, value, error) {
|
|
24
21
|
super(`Unable to decode value as it does not match the expected schema`);
|
|
25
22
|
this.schema = schema;
|
|
@@ -29,10 +26,6 @@ export class TransformDecodeCheckError extends TypeBoxError {
|
|
|
29
26
|
}
|
|
30
27
|
// prettier-ignore
|
|
31
28
|
export class TransformDecodeError extends TypeBoxError {
|
|
32
|
-
schema;
|
|
33
|
-
path;
|
|
34
|
-
value;
|
|
35
|
-
error;
|
|
36
29
|
constructor(schema, path, value, error) {
|
|
37
30
|
super(error instanceof Error ? error.message : 'Unknown error');
|
|
38
31
|
this.schema = schema;
|
|
@@ -16,9 +16,6 @@ import { IsTransform, IsSchema } from '../../type/guard/type.mjs';
|
|
|
16
16
|
// ------------------------------------------------------------------
|
|
17
17
|
// prettier-ignore
|
|
18
18
|
export class TransformEncodeCheckError extends TypeBoxError {
|
|
19
|
-
schema;
|
|
20
|
-
value;
|
|
21
|
-
error;
|
|
22
19
|
constructor(schema, value, error) {
|
|
23
20
|
super(`The encoded value does not match the expected schema`);
|
|
24
21
|
this.schema = schema;
|
|
@@ -28,10 +25,6 @@ export class TransformEncodeCheckError extends TypeBoxError {
|
|
|
28
25
|
}
|
|
29
26
|
// prettier-ignore
|
|
30
27
|
export class TransformEncodeError extends TypeBoxError {
|
|
31
|
-
schema;
|
|
32
|
-
path;
|
|
33
|
-
value;
|
|
34
|
-
error;
|
|
35
28
|
constructor(schema, path, value, error) {
|
|
36
29
|
super(`${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
37
30
|
this.schema = schema;
|