@sinclair/typebox 0.32.15 → 0.32.17

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.
@@ -20,20 +20,24 @@ const type_1 = require("../../type/guard/type");
20
20
  // Errors
21
21
  // ------------------------------------------------------------------
22
22
  // thrown externally
23
+ // prettier-ignore
23
24
  class TransformDecodeCheckError extends index_2.TypeBoxError {
24
25
  constructor(schema, value, error) {
25
- super(`Unable to decode due to invalid value`);
26
+ super(`Unable to decode value as it does not match the expected schema`);
26
27
  this.schema = schema;
27
28
  this.value = value;
28
29
  this.error = error;
29
30
  }
30
31
  }
31
32
  exports.TransformDecodeCheckError = TransformDecodeCheckError;
33
+ // prettier-ignore
32
34
  class TransformDecodeError extends index_2.TypeBoxError {
33
- constructor(schema, value, error) {
34
- super(`${error instanceof Error ? error.message : 'Unknown error'}`);
35
+ constructor(schema, path, value, error) {
36
+ super(error instanceof Error ? error.message : 'Unknown error');
35
37
  this.schema = schema;
38
+ this.path = path;
36
39
  this.value = value;
40
+ this.error = error;
37
41
  }
38
42
  }
39
43
  exports.TransformDecodeError = TransformDecodeError;
@@ -41,144 +45,144 @@ exports.TransformDecodeError = TransformDecodeError;
41
45
  // Decode
42
46
  // ------------------------------------------------------------------
43
47
  // prettier-ignore
44
- function Default(schema, value) {
48
+ function Default(schema, path, value) {
45
49
  try {
46
50
  return (0, type_1.IsTransform)(schema) ? schema[index_1.TransformKind].Decode(value) : value;
47
51
  }
48
52
  catch (error) {
49
- throw new TransformDecodeError(schema, value, error);
53
+ throw new TransformDecodeError(schema, path, value, error);
50
54
  }
51
55
  }
52
56
  // prettier-ignore
53
- function FromArray(schema, references, value) {
57
+ function FromArray(schema, references, path, value) {
54
58
  return ((0, index_7.IsArray)(value))
55
- ? Default(schema, value.map((value) => Visit(schema.items, references, value)))
56
- : Default(schema, value);
59
+ ? Default(schema, path, value.map((value, index) => Visit(schema.items, references, `${path}/${index}`, value)))
60
+ : Default(schema, path, value);
57
61
  }
58
62
  // prettier-ignore
59
- function FromIntersect(schema, references, value) {
63
+ function FromIntersect(schema, references, path, value) {
60
64
  if (!(0, index_7.IsStandardObject)(value) || (0, index_7.IsValueType)(value))
61
- return Default(schema, value);
65
+ return Default(schema, path, value);
62
66
  const knownKeys = (0, index_3.KeyOfPropertyKeys)(schema);
63
67
  const knownProperties = knownKeys.reduce((value, key) => {
64
68
  return (key in value)
65
- ? { ...value, [key]: Visit((0, index_4.Index)(schema, [key]), references, value[key]) }
69
+ ? { ...value, [key]: Visit((0, index_4.Index)(schema, [key]), references, `${path}/${key}`, value[key]) }
66
70
  : value;
67
71
  }, value);
68
72
  if (!(0, type_1.IsTransform)(schema.unevaluatedProperties)) {
69
- return Default(schema, knownProperties);
73
+ return Default(schema, path, knownProperties);
70
74
  }
71
75
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
72
76
  const unevaluatedProperties = schema.unevaluatedProperties;
73
77
  const unknownProperties = unknownKeys.reduce((value, key) => {
74
78
  return !knownKeys.includes(key)
75
- ? { ...value, [key]: Default(unevaluatedProperties, value[key]) }
79
+ ? { ...value, [key]: Default(unevaluatedProperties, `${path}/${key}`, value[key]) }
76
80
  : value;
77
81
  }, knownProperties);
78
- return Default(schema, unknownProperties);
82
+ return Default(schema, path, unknownProperties);
79
83
  }
80
- function FromNot(schema, references, value) {
81
- return Default(schema, Visit(schema.not, references, value));
84
+ function FromNot(schema, references, path, value) {
85
+ return Default(schema, path, Visit(schema.not, references, path, value));
82
86
  }
83
87
  // prettier-ignore
84
- function FromObject(schema, references, value) {
88
+ function FromObject(schema, references, path, value) {
85
89
  if (!(0, index_7.IsStandardObject)(value))
86
- return Default(schema, value);
90
+ return Default(schema, path, value);
87
91
  const knownKeys = (0, index_3.KeyOfPropertyKeys)(schema);
88
92
  const knownProperties = knownKeys.reduce((value, key) => {
89
93
  return (key in value)
90
- ? { ...value, [key]: Visit(schema.properties[key], references, value[key]) }
94
+ ? { ...value, [key]: Visit(schema.properties[key], references, `${path}/${key}`, value[key]) }
91
95
  : value;
92
96
  }, value);
93
97
  if (!(0, type_1.IsSchema)(schema.additionalProperties)) {
94
- return Default(schema, knownProperties);
98
+ return Default(schema, path, knownProperties);
95
99
  }
96
100
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
97
101
  const additionalProperties = schema.additionalProperties;
98
102
  const unknownProperties = unknownKeys.reduce((value, key) => {
99
103
  return !knownKeys.includes(key)
100
- ? { ...value, [key]: Default(additionalProperties, value[key]) }
104
+ ? { ...value, [key]: Default(additionalProperties, `${path}/${key}`, value[key]) }
101
105
  : value;
102
106
  }, knownProperties);
103
- return Default(schema, unknownProperties);
107
+ return Default(schema, path, unknownProperties);
104
108
  }
105
109
  // prettier-ignore
106
- function FromRecord(schema, references, value) {
110
+ function FromRecord(schema, references, path, value) {
107
111
  if (!(0, index_7.IsStandardObject)(value))
108
- return Default(schema, value);
112
+ return Default(schema, path, value);
109
113
  const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
110
114
  const knownKeys = new RegExp(pattern);
111
115
  const knownProperties = Object.getOwnPropertyNames(value).reduce((value, key) => {
112
116
  return knownKeys.test(key)
113
- ? { ...value, [key]: Visit(schema.patternProperties[pattern], references, value[key]) }
117
+ ? { ...value, [key]: Visit(schema.patternProperties[pattern], references, `${path}/${key}`, value[key]) }
114
118
  : value;
115
119
  }, value);
116
120
  if (!(0, type_1.IsSchema)(schema.additionalProperties)) {
117
- return Default(schema, knownProperties);
121
+ return Default(schema, path, knownProperties);
118
122
  }
119
123
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
120
124
  const additionalProperties = schema.additionalProperties;
121
125
  const unknownProperties = unknownKeys.reduce((value, key) => {
122
126
  return !knownKeys.test(key)
123
- ? { ...value, [key]: Default(additionalProperties, value[key]) }
127
+ ? { ...value, [key]: Default(additionalProperties, `${path}/${key}`, value[key]) }
124
128
  : value;
125
129
  }, knownProperties);
126
- return Default(schema, unknownProperties);
130
+ return Default(schema, path, unknownProperties);
127
131
  }
128
132
  // prettier-ignore
129
- function FromRef(schema, references, value) {
133
+ function FromRef(schema, references, path, value) {
130
134
  const target = (0, index_5.Deref)(schema, references);
131
- return Default(schema, Visit(target, references, value));
135
+ return Default(schema, path, Visit(target, references, path, value));
132
136
  }
133
137
  // prettier-ignore
134
- function FromThis(schema, references, value) {
138
+ function FromThis(schema, references, path, value) {
135
139
  const target = (0, index_5.Deref)(schema, references);
136
- return Default(schema, Visit(target, references, value));
140
+ return Default(schema, path, Visit(target, references, path, value));
137
141
  }
138
142
  // prettier-ignore
139
- function FromTuple(schema, references, value) {
143
+ function FromTuple(schema, references, path, value) {
140
144
  return ((0, index_7.IsArray)(value) && (0, index_7.IsArray)(schema.items))
141
- ? Default(schema, schema.items.map((schema, index) => Visit(schema, references, value[index])))
142
- : Default(schema, value);
145
+ ? Default(schema, path, schema.items.map((schema, index) => Visit(schema, references, `${path}/${index}`, value[index])))
146
+ : Default(schema, path, value);
143
147
  }
144
148
  // prettier-ignore
145
- function FromUnion(schema, references, value) {
149
+ function FromUnion(schema, references, path, value) {
146
150
  for (const subschema of schema.anyOf) {
147
151
  if (!(0, index_6.Check)(subschema, references, value))
148
152
  continue;
149
153
  // note: ensure interior is decoded first
150
- const decoded = Visit(subschema, references, value);
151
- return Default(schema, decoded);
154
+ const decoded = Visit(subschema, references, path, value);
155
+ return Default(schema, path, decoded);
152
156
  }
153
- return Default(schema, value);
157
+ return Default(schema, path, value);
154
158
  }
155
159
  // prettier-ignore
156
- function Visit(schema, references, value) {
160
+ function Visit(schema, references, path, value) {
157
161
  const references_ = typeof schema.$id === 'string' ? [...references, schema] : references;
158
162
  const schema_ = schema;
159
163
  switch (schema[index_1.Kind]) {
160
164
  case 'Array':
161
- return FromArray(schema_, references_, value);
165
+ return FromArray(schema_, references_, path, value);
162
166
  case 'Intersect':
163
- return FromIntersect(schema_, references_, value);
167
+ return FromIntersect(schema_, references_, path, value);
164
168
  case 'Not':
165
- return FromNot(schema_, references_, value);
169
+ return FromNot(schema_, references_, path, value);
166
170
  case 'Object':
167
- return FromObject(schema_, references_, value);
171
+ return FromObject(schema_, references_, path, value);
168
172
  case 'Record':
169
- return FromRecord(schema_, references_, value);
173
+ return FromRecord(schema_, references_, path, value);
170
174
  case 'Ref':
171
- return FromRef(schema_, references_, value);
175
+ return FromRef(schema_, references_, path, value);
172
176
  case 'Symbol':
173
- return Default(schema_, value);
177
+ return Default(schema_, path, value);
174
178
  case 'This':
175
- return FromThis(schema_, references_, value);
179
+ return FromThis(schema_, references_, path, value);
176
180
  case 'Tuple':
177
- return FromTuple(schema_, references_, value);
181
+ return FromTuple(schema_, references_, path, value);
178
182
  case 'Union':
179
- return FromUnion(schema_, references_, value);
183
+ return FromUnion(schema_, references_, path, value);
180
184
  default:
181
- return Default(schema_, value);
185
+ return Default(schema_, path, value);
182
186
  }
183
187
  }
184
188
  /**
@@ -187,6 +191,6 @@ function Visit(schema, references, value) {
187
191
  * undefined behavior. Refer to the `Value.Decode()` for implementation details.
188
192
  */
189
193
  function TransformDecode(schema, references, value) {
190
- return Visit(schema, references, value);
194
+ return Visit(schema, references, '', value);
191
195
  }
192
196
  exports.TransformDecode = TransformDecode;
@@ -9,8 +9,10 @@ export declare class TransformEncodeCheckError extends TypeBoxError {
9
9
  }
10
10
  export declare class TransformEncodeError extends TypeBoxError {
11
11
  readonly schema: TSchema;
12
+ readonly path: string;
12
13
  readonly value: unknown;
13
- constructor(schema: TSchema, value: unknown, error: any);
14
+ readonly error: Error;
15
+ constructor(schema: TSchema, path: string, value: unknown, error: Error);
14
16
  }
15
17
  /**
16
18
  * `[Internal]` Encodes the value and returns the result. This function expects the
@@ -19,20 +19,24 @@ const type_1 = require("../../type/guard/type");
19
19
  // ------------------------------------------------------------------
20
20
  // Errors
21
21
  // ------------------------------------------------------------------
22
+ // prettier-ignore
22
23
  class TransformEncodeCheckError extends index_2.TypeBoxError {
23
24
  constructor(schema, value, error) {
24
- super(`Unable to encode due to invalid value`);
25
+ super(`The encoded value does not match the expected schema`);
25
26
  this.schema = schema;
26
27
  this.value = value;
27
28
  this.error = error;
28
29
  }
29
30
  }
30
31
  exports.TransformEncodeCheckError = TransformEncodeCheckError;
32
+ // prettier-ignore
31
33
  class TransformEncodeError extends index_2.TypeBoxError {
32
- constructor(schema, value, error) {
34
+ constructor(schema, path, value, error) {
33
35
  super(`${error instanceof Error ? error.message : 'Unknown error'}`);
34
36
  this.schema = schema;
37
+ this.path = path;
35
38
  this.value = value;
39
+ this.error = error;
36
40
  }
37
41
  }
38
42
  exports.TransformEncodeError = TransformEncodeError;
@@ -40,56 +44,56 @@ exports.TransformEncodeError = TransformEncodeError;
40
44
  // Encode
41
45
  // ------------------------------------------------------------------
42
46
  // prettier-ignore
43
- function Default(schema, value) {
47
+ function Default(schema, path, value) {
44
48
  try {
45
49
  return (0, type_1.IsTransform)(schema) ? schema[index_1.TransformKind].Encode(value) : value;
46
50
  }
47
51
  catch (error) {
48
- throw new TransformEncodeError(schema, value, error);
52
+ throw new TransformEncodeError(schema, path, value, error);
49
53
  }
50
54
  }
51
55
  // prettier-ignore
52
- function FromArray(schema, references, value) {
53
- const defaulted = Default(schema, value);
56
+ function FromArray(schema, references, path, value) {
57
+ const defaulted = Default(schema, path, value);
54
58
  return (0, index_7.IsArray)(defaulted)
55
- ? defaulted.map((value) => Visit(schema.items, references, value))
59
+ ? defaulted.map((value, index) => Visit(schema.items, references, `${path}/${index}`, value))
56
60
  : defaulted;
57
61
  }
58
62
  // prettier-ignore
59
- function FromIntersect(schema, references, value) {
60
- const defaulted = Default(schema, value);
63
+ function FromIntersect(schema, references, path, value) {
64
+ const defaulted = Default(schema, path, value);
61
65
  if (!(0, index_7.IsStandardObject)(value) || (0, index_7.IsValueType)(value))
62
66
  return defaulted;
63
67
  const knownKeys = (0, index_3.KeyOfPropertyKeys)(schema);
64
68
  const knownProperties = knownKeys.reduce((value, key) => {
65
69
  return key in defaulted
66
- ? { ...value, [key]: Visit((0, index_4.Index)(schema, [key]), references, value[key]) }
70
+ ? { ...value, [key]: Visit((0, index_4.Index)(schema, [key]), references, `${path}/${key}`, value[key]) }
67
71
  : value;
68
72
  }, defaulted);
69
73
  if (!(0, type_1.IsTransform)(schema.unevaluatedProperties)) {
70
- return Default(schema, knownProperties);
74
+ return Default(schema, path, knownProperties);
71
75
  }
72
76
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
73
77
  const unevaluatedProperties = schema.unevaluatedProperties;
74
78
  return unknownKeys.reduce((value, key) => {
75
79
  return !knownKeys.includes(key)
76
- ? { ...value, [key]: Default(unevaluatedProperties, value[key]) }
80
+ ? { ...value, [key]: Default(unevaluatedProperties, `${path}/${key}`, value[key]) }
77
81
  : value;
78
82
  }, knownProperties);
79
83
  }
80
84
  // prettier-ignore
81
- function FromNot(schema, references, value) {
82
- return Default(schema.not, Default(schema, value));
85
+ function FromNot(schema, references, path, value) {
86
+ return Default(schema.not, path, Default(schema, path, value));
83
87
  }
84
88
  // prettier-ignore
85
- function FromObject(schema, references, value) {
86
- const defaulted = Default(schema, value);
89
+ function FromObject(schema, references, path, value) {
90
+ const defaulted = Default(schema, path, value);
87
91
  if (!(0, index_7.IsStandardObject)(value))
88
92
  return defaulted;
89
93
  const knownKeys = (0, index_3.KeyOfPropertyKeys)(schema);
90
94
  const knownProperties = knownKeys.reduce((value, key) => {
91
95
  return key in value
92
- ? { ...value, [key]: Visit(schema.properties[key], references, value[key]) }
96
+ ? { ...value, [key]: Visit(schema.properties[key], references, `${path}/${key}`, value[key]) }
93
97
  : value;
94
98
  }, defaulted);
95
99
  if (!(0, type_1.IsSchema)(schema.additionalProperties)) {
@@ -99,93 +103,93 @@ function FromObject(schema, references, value) {
99
103
  const additionalProperties = schema.additionalProperties;
100
104
  return unknownKeys.reduce((value, key) => {
101
105
  return !knownKeys.includes(key)
102
- ? { ...value, [key]: Default(additionalProperties, value[key]) }
106
+ ? { ...value, [key]: Default(additionalProperties, `${path}/${key}`, value[key]) }
103
107
  : value;
104
108
  }, knownProperties);
105
109
  }
106
110
  // prettier-ignore
107
- function FromRecord(schema, references, value) {
108
- const defaulted = Default(schema, value);
111
+ function FromRecord(schema, references, path, value) {
112
+ const defaulted = Default(schema, path, value);
109
113
  if (!(0, index_7.IsStandardObject)(value))
110
114
  return defaulted;
111
115
  const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
112
116
  const knownKeys = new RegExp(pattern);
113
117
  const knownProperties = Object.getOwnPropertyNames(value).reduce((value, key) => {
114
118
  return knownKeys.test(key)
115
- ? { ...value, [key]: Visit(schema.patternProperties[pattern], references, value[key]) }
119
+ ? { ...value, [key]: Visit(schema.patternProperties[pattern], references, `${path}/${key}`, value[key]) }
116
120
  : value;
117
121
  }, defaulted);
118
122
  if (!(0, type_1.IsSchema)(schema.additionalProperties)) {
119
- return Default(schema, knownProperties);
123
+ return Default(schema, path, knownProperties);
120
124
  }
121
125
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
122
126
  const additionalProperties = schema.additionalProperties;
123
127
  return unknownKeys.reduce((value, key) => {
124
128
  return !knownKeys.test(key)
125
- ? { ...value, [key]: Default(additionalProperties, value[key]) }
129
+ ? { ...value, [key]: Default(additionalProperties, `${path}/${key}`, value[key]) }
126
130
  : value;
127
131
  }, knownProperties);
128
132
  }
129
133
  // prettier-ignore
130
- function FromRef(schema, references, value) {
134
+ function FromRef(schema, references, path, value) {
131
135
  const target = (0, index_5.Deref)(schema, references);
132
- const resolved = Visit(target, references, value);
133
- return Default(schema, resolved);
136
+ const resolved = Visit(target, references, path, value);
137
+ return Default(schema, path, resolved);
134
138
  }
135
139
  // prettier-ignore
136
- function FromThis(schema, references, value) {
140
+ function FromThis(schema, references, path, value) {
137
141
  const target = (0, index_5.Deref)(schema, references);
138
- const resolved = Visit(target, references, value);
139
- return Default(schema, resolved);
142
+ const resolved = Visit(target, references, path, value);
143
+ return Default(schema, path, resolved);
140
144
  }
141
145
  // prettier-ignore
142
- function FromTuple(schema, references, value) {
143
- const value1 = Default(schema, value);
144
- return (0, index_7.IsArray)(schema.items) ? schema.items.map((schema, index) => Visit(schema, references, value1[index])) : [];
146
+ function FromTuple(schema, references, path, value) {
147
+ const value1 = Default(schema, path, value);
148
+ return (0, index_7.IsArray)(schema.items) ? schema.items.map((schema, index) => Visit(schema, references, `${path}/${index}`, value1[index])) : [];
145
149
  }
146
150
  // prettier-ignore
147
- function FromUnion(schema, references, value) {
151
+ function FromUnion(schema, references, path, value) {
148
152
  // test value against union variants
149
153
  for (const subschema of schema.anyOf) {
150
154
  if (!(0, index_6.Check)(subschema, references, value))
151
155
  continue;
152
- const value1 = Visit(subschema, references, value);
153
- return Default(schema, value1);
156
+ const value1 = Visit(subschema, references, path, value);
157
+ return Default(schema, path, value1);
154
158
  }
155
159
  // test transformed value against union variants
156
160
  for (const subschema of schema.anyOf) {
157
- const value1 = Visit(subschema, references, value);
161
+ const value1 = Visit(subschema, references, path, value);
158
162
  if (!(0, index_6.Check)(schema, references, value1))
159
163
  continue;
160
- return Default(schema, value1);
164
+ return Default(schema, path, value1);
161
165
  }
162
- return Default(schema, value);
166
+ return Default(schema, path, value);
163
167
  }
164
168
  // prettier-ignore
165
- function Visit(schema, references, value) {
169
+ function Visit(schema, references, path, value) {
166
170
  const references_ = typeof schema.$id === 'string' ? [...references, schema] : references;
167
171
  const schema_ = schema;
168
172
  switch (schema[index_1.Kind]) {
169
173
  case 'Array':
170
- return FromArray(schema_, references_, value);
174
+ return FromArray(schema_, references_, path, value);
171
175
  case 'Intersect':
172
- return FromIntersect(schema_, references_, value);
176
+ return FromIntersect(schema_, references_, path, value);
173
177
  case 'Not':
174
- return FromNot(schema_, references_, value);
178
+ return FromNot(schema_, references_, path, value);
175
179
  case 'Object':
176
- return FromObject(schema_, references_, value);
180
+ return FromObject(schema_, references_, path, value);
177
181
  case 'Record':
178
- return FromRecord(schema_, references_, value);
182
+ return FromRecord(schema_, references_, path, value);
179
183
  case 'Ref':
180
- return FromRef(schema_, references_, value);
184
+ return FromRef(schema_, references_, path, value);
181
185
  case 'This':
182
- return FromThis(schema_, references_, value);
186
+ return FromThis(schema_, references_, path, value);
183
187
  case 'Tuple':
184
- return FromTuple(schema_, references_, value);
188
+ return FromTuple(schema_, references_, path, value);
185
189
  case 'Union':
186
- return FromUnion(schema_, references_, value);
190
+ return FromUnion(schema_, references_, path, value);
187
191
  default:
188
- return Default(schema_, value);
192
+ return Default(schema_, path, value);
189
193
  }
190
194
  }
191
195
  /**
@@ -195,6 +199,6 @@ function Visit(schema, references, value) {
195
199
  * `Value.Encode()` function for implementation details.
196
200
  */
197
201
  function TransformEncode(schema, references, value) {
198
- return Visit(schema, references, value);
202
+ return Visit(schema, references, '', value);
199
203
  }
200
204
  exports.TransformEncode = TransformEncode;
@@ -63,7 +63,7 @@ function Encode(...args) {
63
63
  const [schema, references, value] = args.length === 3 ? [args[0], args[1], args[2]] : [args[0], [], args[1]];
64
64
  const encoded = (0, index_1.TransformEncode)(schema, references, value);
65
65
  if (!Check(schema, references, encoded))
66
- throw new index_1.TransformEncodeCheckError(schema, value, Errors(schema, references, value).First());
66
+ throw new index_1.TransformEncodeCheckError(schema, encoded, Errors(schema, references, encoded).First());
67
67
  return encoded;
68
68
  }
69
69
  exports.Encode = Encode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinclair/typebox",
3
- "version": "0.32.15",
3
+ "version": "0.32.17",
4
4
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
package/readme.md CHANGED
@@ -1694,6 +1694,7 @@ The following is a list of community packages that offer general tooling, extend
1694
1694
  | [http-wizard](https://github.com/flodlc/http-wizard) | Type safe http client library for Fastify |
1695
1695
  | [openapi-box](https://github.com/geut/openapi-box) | Generate TypeBox types from OpenApi IDL + Http client library |
1696
1696
  | [schema2typebox](https://github.com/xddq/schema2typebox) | Creating TypeBox code from Json Schemas |
1697
+ | [sveltekit-superforms](https://github.com/ciscoheat/sveltekit-superforms) | A comprehensive SvelteKit form library for server and client validation |
1697
1698
  | [ts2typebox](https://github.com/xddq/ts2typebox) | Creating TypeBox code from Typescript types |
1698
1699
  | [typebox-form-parser](https://github.com/jtlapp/typebox-form-parser) | Parses form and query data based on TypeBox schemas |
1699
1700
  | [typebox-validators](https://github.com/jtlapp/typebox-validators) | Advanced validators supporting discriminated and heterogeneous unions |