typesea 0.2.0 → 0.3.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/CHANGELOG.md +40 -0
- package/README.md +104 -41
- package/SECURITY.md +52 -0
- package/dist/aot/index.d.ts +1 -1
- package/dist/aot/index.d.ts.map +1 -1
- package/dist/aot/index.js +22 -3
- package/dist/builders/composite.d.ts +6 -3
- package/dist/builders/composite.d.ts.map +1 -1
- package/dist/builders/composite.js +22 -13
- package/dist/builders/index.d.ts +6 -5
- package/dist/builders/index.d.ts.map +1 -1
- package/dist/builders/index.js +5 -4
- package/dist/builders/modifier.d.ts +6 -0
- package/dist/builders/modifier.d.ts.map +1 -1
- package/dist/builders/modifier.js +14 -0
- package/dist/builders/object/guard.d.ts +54 -2
- package/dist/builders/object/guard.d.ts.map +1 -1
- package/dist/builders/object/guard.js +117 -7
- package/dist/builders/object/index.d.ts +2 -2
- package/dist/builders/object/index.d.ts.map +1 -1
- package/dist/builders/object/index.js +1 -1
- package/dist/builders/object/schema.d.ts +33 -2
- package/dist/builders/object/schema.d.ts.map +1 -1
- package/dist/builders/object/schema.js +198 -8
- package/dist/builders/object/types.d.ts +15 -0
- package/dist/builders/object/types.d.ts.map +1 -1
- package/dist/builders/runtime.d.ts +40 -0
- package/dist/builders/runtime.d.ts.map +1 -0
- package/dist/builders/runtime.js +150 -0
- package/dist/builders/scalar.d.ts +20 -1
- package/dist/builders/scalar.d.ts.map +1 -1
- package/dist/builders/scalar.js +54 -1
- package/dist/builders/table.d.ts +31 -5
- package/dist/builders/table.d.ts.map +1 -1
- package/dist/builders/table.js +31 -5
- package/dist/builders/types.d.ts +6 -0
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/compile/check-composite.d.ts +3 -1
- package/dist/compile/check-composite.d.ts.map +1 -1
- package/dist/compile/check-composite.js +143 -11
- package/dist/compile/check-scalar.d.ts +10 -0
- package/dist/compile/check-scalar.d.ts.map +1 -1
- package/dist/compile/check-scalar.js +138 -2
- package/dist/compile/check.d.ts.map +1 -1
- package/dist/compile/check.js +25 -3
- package/dist/compile/context.d.ts.map +1 -1
- package/dist/compile/context.js +2 -0
- package/dist/compile/first.d.ts +26 -0
- package/dist/compile/first.d.ts.map +1 -0
- package/dist/compile/first.js +850 -0
- package/dist/compile/graph-predicate.d.ts.map +1 -1
- package/dist/compile/graph-predicate.js +389 -18
- package/dist/compile/guard.d.ts +2 -1
- package/dist/compile/guard.d.ts.map +1 -1
- package/dist/compile/guard.js +54 -8
- package/dist/compile/predicate.d.ts.map +1 -1
- package/dist/compile/predicate.js +156 -5
- package/dist/compile/runtime.d.ts +20 -1
- package/dist/compile/runtime.d.ts.map +1 -1
- package/dist/compile/runtime.js +31 -0
- package/dist/compile/source.d.ts.map +1 -1
- package/dist/compile/source.js +27 -3
- package/dist/compile/types.d.ts +2 -0
- package/dist/compile/types.d.ts.map +1 -1
- package/dist/decoder/index.d.ts +60 -0
- package/dist/decoder/index.d.ts.map +1 -1
- package/dist/decoder/index.js +164 -1
- package/dist/evaluate/check-composite.d.ts +52 -2
- package/dist/evaluate/check-composite.d.ts.map +1 -1
- package/dist/evaluate/check-composite.js +193 -6
- package/dist/evaluate/check-scalar.d.ts +9 -0
- package/dist/evaluate/check-scalar.d.ts.map +1 -1
- package/dist/evaluate/check-scalar.js +92 -3
- package/dist/evaluate/check.d.ts.map +1 -1
- package/dist/evaluate/check.js +19 -4
- package/dist/evaluate/shared.d.ts +19 -0
- package/dist/evaluate/shared.d.ts.map +1 -1
- package/dist/evaluate/shared.js +35 -0
- package/dist/guard/array.d.ts +48 -0
- package/dist/guard/array.d.ts.map +1 -0
- package/dist/guard/array.js +84 -0
- package/dist/guard/base.d.ts +32 -2
- package/dist/guard/base.d.ts.map +1 -1
- package/dist/guard/base.js +74 -3
- package/dist/guard/date.d.ts +34 -0
- package/dist/guard/date.d.ts.map +1 -0
- package/dist/guard/date.js +60 -0
- package/dist/guard/index.d.ts +2 -0
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +2 -0
- package/dist/guard/number.d.ts +60 -0
- package/dist/guard/number.d.ts.map +1 -1
- package/dist/guard/number.js +129 -0
- package/dist/guard/read.d.ts +53 -1
- package/dist/guard/read.d.ts.map +1 -1
- package/dist/guard/read.js +102 -0
- package/dist/guard/string.d.ts +82 -0
- package/dist/guard/string.d.ts.map +1 -1
- package/dist/guard/string.js +213 -0
- package/dist/guard/types.d.ts +18 -0
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/ir/builder.d.ts +3 -3
- package/dist/ir/builder.d.ts.map +1 -1
- package/dist/ir/builder.js +5 -2
- package/dist/ir/freeze.js +7 -0
- package/dist/ir/types.d.ts +4 -1
- package/dist/ir/types.d.ts.map +1 -1
- package/dist/ir/validate.d.ts.map +1 -1
- package/dist/ir/validate.js +35 -1
- package/dist/issue/index.d.ts +1 -1
- package/dist/issue/index.d.ts.map +1 -1
- package/dist/issue/index.js +4 -0
- package/dist/json-schema/emit-composite.d.ts +6 -2
- package/dist/json-schema/emit-composite.d.ts.map +1 -1
- package/dist/json-schema/emit-composite.js +66 -12
- package/dist/json-schema/emit-scalar.d.ts.map +1 -1
- package/dist/json-schema/emit-scalar.js +54 -1
- package/dist/json-schema/emit.d.ts.map +1 -1
- package/dist/json-schema/emit.js +11 -2
- package/dist/json-schema/types.d.ts +7 -1
- package/dist/json-schema/types.d.ts.map +1 -1
- package/dist/kind/index.d.ts +25 -0
- package/dist/kind/index.d.ts.map +1 -1
- package/dist/kind/index.js +26 -3
- package/dist/lower/index.d.ts.map +1 -1
- package/dist/lower/index.js +52 -3
- package/dist/message/index.d.ts +18 -0
- package/dist/message/index.d.ts.map +1 -1
- package/dist/message/index.js +67 -0
- package/dist/optimize/domain.js +6 -2
- package/dist/optimize/map-node.d.ts.map +1 -1
- package/dist/optimize/map-node.js +3 -0
- package/dist/plan/cache.js +13 -1
- package/dist/plan/predicate.d.ts.map +1 -1
- package/dist/plan/predicate.js +33 -3
- package/dist/plan/schema-predicate.d.ts.map +1 -1
- package/dist/plan/schema-predicate.js +267 -8
- package/dist/schema/freeze.js +22 -0
- package/dist/schema/index.d.ts +2 -2
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/types.d.ts +89 -4
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +8 -1
- package/dist/schema/undefined.d.ts.map +1 -1
- package/dist/schema/undefined.js +5 -0
- package/dist/schema/validate.d.ts.map +1 -1
- package/dist/schema/validate.js +111 -4
- package/docs/api.md +79 -10
- package/docs/assets/benchmark-headline.svg +33 -33
- package/docs/engine-notes.md +9 -5
- package/docs/index.html +1366 -722
- package/docs/ko/api.md +383 -0
- package/docs/ko/engine-notes.md +156 -0
- package/docs/ko/readme.md +404 -0
- package/package.json +6 -2
package/dist/guard/read.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @details Guard helpers build new immutable schema wrappers so fluent APIs never mutate an
|
|
5
5
|
* existing guard instance.
|
|
6
6
|
*/
|
|
7
|
-
import type { NumberSchema, Schema, StringSchema } from "../schema/index.js";
|
|
7
|
+
import type { ArraySchema, DateSchema, NumberSchema, Schema, StringSchema } from "../schema/index.js";
|
|
8
8
|
/**
|
|
9
9
|
* @brief Read schema from a verified guard receiver.
|
|
10
10
|
* @details Constructed guards take the WeakSet fast path; forged structural
|
|
@@ -36,6 +36,24 @@ export declare function readStringMethodSchema(guard: unknown, label: string): S
|
|
|
36
36
|
* when a receiver is detached or structurally forged.
|
|
37
37
|
*/
|
|
38
38
|
export declare function readNumberMethodSchema(guard: unknown, label: string): NumberSchema;
|
|
39
|
+
/**
|
|
40
|
+
* @brief Read and require a Date schema from a method receiver.
|
|
41
|
+
* @param guard Candidate receiver.
|
|
42
|
+
* @param label Human-readable label used in TypeError messages.
|
|
43
|
+
* @returns Date schema carried by the receiver.
|
|
44
|
+
* @throws TypeError when the receiver is not a Date guard.
|
|
45
|
+
*/
|
|
46
|
+
export declare function readDateMethodSchema(guard: unknown, label: string): DateSchema;
|
|
47
|
+
/**
|
|
48
|
+
* @brief Read and require an array schema from a method receiver.
|
|
49
|
+
* @param guard Candidate receiver.
|
|
50
|
+
* @param label Human-readable label used in TypeError messages.
|
|
51
|
+
* @returns Array schema carried by the receiver.
|
|
52
|
+
* @throws TypeError when the receiver is not an array guard.
|
|
53
|
+
* @details ArrayGuard methods share this gate so fluent length helpers cannot
|
|
54
|
+
* be detached and applied to unrelated guard instances.
|
|
55
|
+
*/
|
|
56
|
+
export declare function readArrayMethodSchema(guard: unknown, label: string): ArraySchema;
|
|
39
57
|
/**
|
|
40
58
|
* @brief Validate and freeze a generic guard constructor schema.
|
|
41
59
|
* @param schema Candidate runtime schema.
|
|
@@ -63,6 +81,22 @@ export declare function readStringConstructorSchema(schema: unknown): StringSche
|
|
|
63
81
|
* helper methods from observing incompatible check vectors.
|
|
64
82
|
*/
|
|
65
83
|
export declare function readNumberConstructorSchema(schema: unknown): NumberSchema;
|
|
84
|
+
/**
|
|
85
|
+
* @brief Validate a DateGuard constructor schema.
|
|
86
|
+
* @param schema Candidate runtime schema.
|
|
87
|
+
* @returns Date schema accepted by DateGuard.
|
|
88
|
+
* @throws TypeError when the schema is not a Date schema.
|
|
89
|
+
*/
|
|
90
|
+
export declare function readDateConstructorSchema(schema: unknown): DateSchema;
|
|
91
|
+
/**
|
|
92
|
+
* @brief Validate an ArrayGuard constructor schema.
|
|
93
|
+
* @param schema Candidate runtime schema.
|
|
94
|
+
* @returns Array schema accepted by ArrayGuard.
|
|
95
|
+
* @throws TypeError when the schema is not an array schema.
|
|
96
|
+
* @details The schema validator already checks the item tree and length-check
|
|
97
|
+
* vector, so the specialized constructor only enforces the root tag.
|
|
98
|
+
*/
|
|
99
|
+
export declare function readArrayConstructorSchema(schema: unknown): ArraySchema;
|
|
66
100
|
/**
|
|
67
101
|
* @brief Validate refinement API inputs.
|
|
68
102
|
* @param predicate Candidate refinement predicate.
|
|
@@ -82,6 +116,16 @@ export declare function checkRefinementInput(predicate: unknown, name: unknown):
|
|
|
82
116
|
* emit straight comparisons without defensive range checks.
|
|
83
117
|
*/
|
|
84
118
|
export declare function checkStringLengthBound(value: number, label: string): number;
|
|
119
|
+
/**
|
|
120
|
+
* @brief Validate a non-negative array length bound.
|
|
121
|
+
* @param value Candidate bound.
|
|
122
|
+
* @param label Bound label used in RangeError messages.
|
|
123
|
+
* @returns The validated bound.
|
|
124
|
+
* @throws RangeError when the bound is negative or non-integer.
|
|
125
|
+
* @details Array bounds share the same integer contract as string length
|
|
126
|
+
* bounds, but the separate helper keeps public error text precise.
|
|
127
|
+
*/
|
|
128
|
+
export declare function checkArrayLengthBound(value: number, label: string): number;
|
|
85
129
|
/**
|
|
86
130
|
* @brief Validate a finite numeric bound.
|
|
87
131
|
* @param value Candidate bound.
|
|
@@ -92,4 +136,12 @@ export declare function checkStringLengthBound(value: number, label: string): nu
|
|
|
92
136
|
* aligned for comparisons such as gte and lte.
|
|
93
137
|
*/
|
|
94
138
|
export declare function checkFiniteNumberBound(value: number, label: string): number;
|
|
139
|
+
/**
|
|
140
|
+
* @brief Normalize a Date bound into a finite epoch millisecond value.
|
|
141
|
+
* @param value Candidate Date bound.
|
|
142
|
+
* @param label Bound label used in RangeError messages.
|
|
143
|
+
* @returns Finite epoch millisecond value.
|
|
144
|
+
* @throws RangeError when the bound is not a valid Date instance.
|
|
145
|
+
*/
|
|
146
|
+
export declare function checkDateBound(value: Date, label: string): number;
|
|
95
147
|
//# sourceMappingURL=read.d.ts.map
|
package/dist/guard/read.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/guard/read.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/guard/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AO,CAOlD;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK3E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASjE"}
|
package/dist/guard/read.js
CHANGED
|
@@ -81,6 +81,50 @@ export function readNumberMethodSchema(guard, label) {
|
|
|
81
81
|
}
|
|
82
82
|
return schema;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* @brief Read and require a Date schema from a method receiver.
|
|
86
|
+
* @param guard Candidate receiver.
|
|
87
|
+
* @param label Human-readable label used in TypeError messages.
|
|
88
|
+
* @returns Date schema carried by the receiver.
|
|
89
|
+
* @throws TypeError when the receiver is not a Date guard.
|
|
90
|
+
*/
|
|
91
|
+
export function readDateMethodSchema(guard, label) {
|
|
92
|
+
if (isConstructedGuard(guard)) {
|
|
93
|
+
const schema = guard.schema;
|
|
94
|
+
if (schema.tag !== SchemaTag.Date) {
|
|
95
|
+
throw new TypeError(`${label} must be a date TypeSea guard`);
|
|
96
|
+
}
|
|
97
|
+
return schema;
|
|
98
|
+
}
|
|
99
|
+
const schema = readGuardSchema(guard, label);
|
|
100
|
+
if (schema.tag !== SchemaTag.Date) {
|
|
101
|
+
throw new TypeError(`${label} must be a date TypeSea guard`);
|
|
102
|
+
}
|
|
103
|
+
return schema;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @brief Read and require an array schema from a method receiver.
|
|
107
|
+
* @param guard Candidate receiver.
|
|
108
|
+
* @param label Human-readable label used in TypeError messages.
|
|
109
|
+
* @returns Array schema carried by the receiver.
|
|
110
|
+
* @throws TypeError when the receiver is not an array guard.
|
|
111
|
+
* @details ArrayGuard methods share this gate so fluent length helpers cannot
|
|
112
|
+
* be detached and applied to unrelated guard instances.
|
|
113
|
+
*/
|
|
114
|
+
export function readArrayMethodSchema(guard, label) {
|
|
115
|
+
if (isConstructedGuard(guard)) {
|
|
116
|
+
const schema = guard.schema;
|
|
117
|
+
if (schema.tag !== SchemaTag.Array) {
|
|
118
|
+
throw new TypeError(`${label} must be an array TypeSea guard`);
|
|
119
|
+
}
|
|
120
|
+
return schema;
|
|
121
|
+
}
|
|
122
|
+
const schema = readGuardSchema(guard, label);
|
|
123
|
+
if (schema.tag !== SchemaTag.Array) {
|
|
124
|
+
throw new TypeError(`${label} must be an array TypeSea guard`);
|
|
125
|
+
}
|
|
126
|
+
return schema;
|
|
127
|
+
}
|
|
84
128
|
/**
|
|
85
129
|
* @brief Validate and freeze a generic guard constructor schema.
|
|
86
130
|
* @param schema Candidate runtime schema.
|
|
@@ -123,6 +167,32 @@ export function readNumberConstructorSchema(schema) {
|
|
|
123
167
|
}
|
|
124
168
|
return schema;
|
|
125
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* @brief Validate a DateGuard constructor schema.
|
|
172
|
+
* @param schema Candidate runtime schema.
|
|
173
|
+
* @returns Date schema accepted by DateGuard.
|
|
174
|
+
* @throws TypeError when the schema is not a Date schema.
|
|
175
|
+
*/
|
|
176
|
+
export function readDateConstructorSchema(schema) {
|
|
177
|
+
if (!isSchemaValue(schema) || schema.tag !== SchemaTag.Date) {
|
|
178
|
+
throw new TypeError("DateGuard constructor requires a date schema");
|
|
179
|
+
}
|
|
180
|
+
return schema;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* @brief Validate an ArrayGuard constructor schema.
|
|
184
|
+
* @param schema Candidate runtime schema.
|
|
185
|
+
* @returns Array schema accepted by ArrayGuard.
|
|
186
|
+
* @throws TypeError when the schema is not an array schema.
|
|
187
|
+
* @details The schema validator already checks the item tree and length-check
|
|
188
|
+
* vector, so the specialized constructor only enforces the root tag.
|
|
189
|
+
*/
|
|
190
|
+
export function readArrayConstructorSchema(schema) {
|
|
191
|
+
if (!isSchemaValue(schema) || schema.tag !== SchemaTag.Array) {
|
|
192
|
+
throw new TypeError("ArrayGuard constructor requires an array schema");
|
|
193
|
+
}
|
|
194
|
+
return schema;
|
|
195
|
+
}
|
|
126
196
|
/**
|
|
127
197
|
* @brief Validate refinement API inputs.
|
|
128
198
|
* @param predicate Candidate refinement predicate.
|
|
@@ -154,6 +224,21 @@ export function checkStringLengthBound(value, label) {
|
|
|
154
224
|
}
|
|
155
225
|
return value;
|
|
156
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* @brief Validate a non-negative array length bound.
|
|
229
|
+
* @param value Candidate bound.
|
|
230
|
+
* @param label Bound label used in RangeError messages.
|
|
231
|
+
* @returns The validated bound.
|
|
232
|
+
* @throws RangeError when the bound is negative or non-integer.
|
|
233
|
+
* @details Array bounds share the same integer contract as string length
|
|
234
|
+
* bounds, but the separate helper keeps public error text precise.
|
|
235
|
+
*/
|
|
236
|
+
export function checkArrayLengthBound(value, label) {
|
|
237
|
+
if (!Number.isInteger(value) || value < 0) {
|
|
238
|
+
throw new RangeError(`${label} array length bound must be a non-negative integer`);
|
|
239
|
+
}
|
|
240
|
+
return value;
|
|
241
|
+
}
|
|
157
242
|
/**
|
|
158
243
|
* @brief Validate a finite numeric bound.
|
|
159
244
|
* @param value Candidate bound.
|
|
@@ -169,6 +254,23 @@ export function checkFiniteNumberBound(value, label) {
|
|
|
169
254
|
}
|
|
170
255
|
return value;
|
|
171
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* @brief Normalize a Date bound into a finite epoch millisecond value.
|
|
259
|
+
* @param value Candidate Date bound.
|
|
260
|
+
* @param label Bound label used in RangeError messages.
|
|
261
|
+
* @returns Finite epoch millisecond value.
|
|
262
|
+
* @throws RangeError when the bound is not a valid Date instance.
|
|
263
|
+
*/
|
|
264
|
+
export function checkDateBound(value, label) {
|
|
265
|
+
if (!(value instanceof Date)) {
|
|
266
|
+
throw new RangeError(`${label} date bound must be a Date`);
|
|
267
|
+
}
|
|
268
|
+
const time = Date.prototype.getTime.call(value);
|
|
269
|
+
if (!Number.isFinite(time)) {
|
|
270
|
+
throw new RangeError(`${label} date bound must be valid`);
|
|
271
|
+
}
|
|
272
|
+
return time;
|
|
273
|
+
}
|
|
172
274
|
/**
|
|
173
275
|
* @brief Read one own data slot from a structural guard receiver.
|
|
174
276
|
* @param value Candidate receiver.
|
package/dist/guard/string.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @details Guard helpers build new immutable schema wrappers so fluent APIs never mutate an
|
|
5
5
|
* existing guard instance.
|
|
6
6
|
*/
|
|
7
|
+
import { type BaseDecoder } from "../decoder/index.js";
|
|
7
8
|
import type { StringSchema } from "../schema/index.js";
|
|
8
9
|
import { BaseGuard } from "./base.js";
|
|
9
10
|
import type { Presence } from "./types.js";
|
|
@@ -36,6 +37,17 @@ export declare class StringGuard<TPresence extends Presence = "required"> extend
|
|
|
36
37
|
* @returns Fresh StringGuard with an appended max check.
|
|
37
38
|
*/
|
|
38
39
|
max(value: number): StringGuard<TPresence>;
|
|
40
|
+
/**
|
|
41
|
+
* @brief Require an exact string length.
|
|
42
|
+
* @param value Non-negative integer length.
|
|
43
|
+
* @returns Fresh StringGuard with matching min and max bounds.
|
|
44
|
+
*/
|
|
45
|
+
length(value: number): StringGuard<TPresence>;
|
|
46
|
+
/**
|
|
47
|
+
* @brief Require a non-empty string.
|
|
48
|
+
* @returns Fresh StringGuard with `min(1)`.
|
|
49
|
+
*/
|
|
50
|
+
nonempty(): StringGuard<TPresence>;
|
|
39
51
|
/**
|
|
40
52
|
* @brief Add a regular expression check.
|
|
41
53
|
* @details Guard helpers build new immutable schema wrappers so fluent APIs never mutate an
|
|
@@ -45,6 +57,24 @@ export declare class StringGuard<TPresence extends Presence = "required"> extend
|
|
|
45
57
|
* @returns Fresh StringGuard with an appended regex check.
|
|
46
58
|
*/
|
|
47
59
|
regex(pattern: RegExp, name: string): StringGuard<TPresence>;
|
|
60
|
+
/**
|
|
61
|
+
* @brief Require a fixed prefix.
|
|
62
|
+
* @param value Prefix string matched at offset zero.
|
|
63
|
+
* @returns Fresh StringGuard with an escaped prefix regex.
|
|
64
|
+
*/
|
|
65
|
+
startsWith(value: string): StringGuard<TPresence>;
|
|
66
|
+
/**
|
|
67
|
+
* @brief Require a fixed suffix.
|
|
68
|
+
* @param value Suffix string matched at the end of the input.
|
|
69
|
+
* @returns Fresh StringGuard with an escaped suffix regex.
|
|
70
|
+
*/
|
|
71
|
+
endsWith(value: string): StringGuard<TPresence>;
|
|
72
|
+
/**
|
|
73
|
+
* @brief Require a fixed substring.
|
|
74
|
+
* @param value Substring that must appear in the input.
|
|
75
|
+
* @returns Fresh StringGuard with an escaped substring regex.
|
|
76
|
+
*/
|
|
77
|
+
includes(value: string): StringGuard<TPresence>;
|
|
48
78
|
/**
|
|
49
79
|
* @brief Add the built-in UUID string check.
|
|
50
80
|
* @details Guard helpers build new immutable schema wrappers so fluent APIs never mutate an
|
|
@@ -52,5 +82,57 @@ export declare class StringGuard<TPresence extends Presence = "required"> extend
|
|
|
52
82
|
* @returns Fresh StringGuard with an appended uuid check.
|
|
53
83
|
*/
|
|
54
84
|
uuid(): StringGuard<TPresence>;
|
|
85
|
+
/**
|
|
86
|
+
* @brief Add the built-in email string check.
|
|
87
|
+
* @returns Fresh StringGuard with an appended email check.
|
|
88
|
+
*/
|
|
89
|
+
email(): StringGuard<TPresence>;
|
|
90
|
+
/**
|
|
91
|
+
* @brief Add the built-in URL string check.
|
|
92
|
+
* @returns Fresh StringGuard with an appended URL check.
|
|
93
|
+
* @details The check is a deterministic grammar subset rather than a
|
|
94
|
+
* throwing URL constructor call, so AOT and runtime validators agree.
|
|
95
|
+
*/
|
|
96
|
+
url(): StringGuard<TPresence>;
|
|
97
|
+
/**
|
|
98
|
+
* @brief Add the built-in ISO date check.
|
|
99
|
+
* @returns Fresh StringGuard with an appended ISO date check.
|
|
100
|
+
*/
|
|
101
|
+
isoDate(): StringGuard<TPresence>;
|
|
102
|
+
/**
|
|
103
|
+
* @brief Add the built-in ISO date-time check.
|
|
104
|
+
* @returns Fresh StringGuard with an appended ISO date-time check.
|
|
105
|
+
*/
|
|
106
|
+
isoDateTime(): StringGuard<TPresence>;
|
|
107
|
+
/**
|
|
108
|
+
* @brief Add the built-in ULID string check.
|
|
109
|
+
* @returns Fresh StringGuard with an appended ULID check.
|
|
110
|
+
*/
|
|
111
|
+
ulid(): StringGuard<TPresence>;
|
|
112
|
+
/**
|
|
113
|
+
* @brief Add the built-in IPv4 string check.
|
|
114
|
+
* @returns Fresh StringGuard with an appended IPv4 check.
|
|
115
|
+
*/
|
|
116
|
+
ipv4(): StringGuard<TPresence>;
|
|
117
|
+
/**
|
|
118
|
+
* @brief Add the built-in IPv6 string check.
|
|
119
|
+
* @returns Fresh StringGuard with an appended IPv6 check.
|
|
120
|
+
*/
|
|
121
|
+
ipv6(): StringGuard<TPresence>;
|
|
122
|
+
/**
|
|
123
|
+
* @brief Decode a string and trim surrounding whitespace.
|
|
124
|
+
* @returns Decoder that validates this string guard before trimming.
|
|
125
|
+
*/
|
|
126
|
+
trim(): BaseDecoder<string>;
|
|
127
|
+
/**
|
|
128
|
+
* @brief Decode a string and lowercase it.
|
|
129
|
+
* @returns Decoder that validates this string guard before lowercasing.
|
|
130
|
+
*/
|
|
131
|
+
toLowerCase(): BaseDecoder<string>;
|
|
132
|
+
/**
|
|
133
|
+
* @brief Decode a string and uppercase it.
|
|
134
|
+
* @returns Decoder that validates this string guard before uppercasing.
|
|
135
|
+
*/
|
|
136
|
+
toUpperCase(): BaseDecoder<string>;
|
|
55
137
|
}
|
|
56
138
|
//# sourceMappingURL=string.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/guard/string.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAOtC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/guard/string.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAOtC,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,YAAY,CAAC;AAElD;;;;GAIG;AACH,qBAAa,WAAW,CACpB,SAAS,SAAS,QAAQ,GAAG,UAAU,CACzC,SAAQ,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;IAElC;;;;;OAKG;gBACgB,MAAM,EAAE,YAAY;IAKvC;;;;;;OAMG;IACI,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;IAejD;;;;;;OAMG;IACI,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;IAejD;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;IAKpD;;;OAGG;IACI,QAAQ,IAAI,WAAW,CAAC,SAAS,CAAC;IAIzC;;;;;;;OAOG;IACI,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;IAyBnE;;;;OAIG;IACI,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;IAOxD;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;IAOtD;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC;IAOtD;;;;;OAKG;IACI,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC;IAarC;;;OAGG;IACI,KAAK,IAAI,WAAW,CAAC,SAAS,CAAC;IAatC;;;;;OAKG;IACI,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC;IAapC;;;OAGG;IACI,OAAO,IAAI,WAAW,CAAC,SAAS,CAAC;IAaxC;;;OAGG;IACI,WAAW,IAAI,WAAW,CAAC,SAAS,CAAC;IAa5C;;;OAGG;IACI,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC;IAarC;;;OAGG;IACI,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC;IAarC;;;OAGG;IACI,IAAI,IAAI,WAAW,CAAC,SAAS,CAAC;IAarC;;;OAGG;IACI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC;IAKlC;;;OAGG;IACI,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC;IAKzC;;;OAGG;IACI,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC;CAI5C"}
|
package/dist/guard/string.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* existing guard instance.
|
|
6
6
|
*/
|
|
7
7
|
import { SchemaTag, StringCheckTag } from "../kind/index.js";
|
|
8
|
+
import { transform } from "../decoder/index.js";
|
|
8
9
|
import { BaseGuard } from "./base.js";
|
|
9
10
|
import { isPlainRegExp } from "./props.js";
|
|
10
11
|
import { checkStringLengthBound, readStringConstructorSchema, readStringMethodSchema } from "./read.js";
|
|
@@ -66,6 +67,22 @@ export class StringGuard extends BaseGuard {
|
|
|
66
67
|
]
|
|
67
68
|
});
|
|
68
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* @brief Require an exact string length.
|
|
72
|
+
* @param value Non-negative integer length.
|
|
73
|
+
* @returns Fresh StringGuard with matching min and max bounds.
|
|
74
|
+
*/
|
|
75
|
+
length(value) {
|
|
76
|
+
const bound = checkStringLengthBound(value, "length");
|
|
77
|
+
return this.min(bound).max(bound);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @brief Require a non-empty string.
|
|
81
|
+
* @returns Fresh StringGuard with `min(1)`.
|
|
82
|
+
*/
|
|
83
|
+
nonempty() {
|
|
84
|
+
return this.min(1);
|
|
85
|
+
}
|
|
69
86
|
/**
|
|
70
87
|
* @brief Add a regular expression check.
|
|
71
88
|
* @details Guard helpers build new immutable schema wrappers so fluent APIs never mutate an
|
|
@@ -98,6 +115,30 @@ export class StringGuard extends BaseGuard {
|
|
|
98
115
|
]
|
|
99
116
|
});
|
|
100
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* @brief Require a fixed prefix.
|
|
120
|
+
* @param value Prefix string matched at offset zero.
|
|
121
|
+
* @returns Fresh StringGuard with an escaped prefix regex.
|
|
122
|
+
*/
|
|
123
|
+
startsWith(value) {
|
|
124
|
+
return this.regex(new RegExp(`^${escapeRegExpString(readStringNeedle(value, "startsWith"))}`, "u"), "starts_with");
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* @brief Require a fixed suffix.
|
|
128
|
+
* @param value Suffix string matched at the end of the input.
|
|
129
|
+
* @returns Fresh StringGuard with an escaped suffix regex.
|
|
130
|
+
*/
|
|
131
|
+
endsWith(value) {
|
|
132
|
+
return this.regex(new RegExp(`${escapeRegExpString(readStringNeedle(value, "endsWith"))}$`, "u"), "ends_with");
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @brief Require a fixed substring.
|
|
136
|
+
* @param value Substring that must appear in the input.
|
|
137
|
+
* @returns Fresh StringGuard with an escaped substring regex.
|
|
138
|
+
*/
|
|
139
|
+
includes(value) {
|
|
140
|
+
return this.regex(new RegExp(escapeRegExpString(readStringNeedle(value, "includes")), "u"), "includes");
|
|
141
|
+
}
|
|
101
142
|
/**
|
|
102
143
|
* @brief Add the built-in UUID string check.
|
|
103
144
|
* @details Guard helpers build new immutable schema wrappers so fluent APIs never mutate an
|
|
@@ -116,4 +157,176 @@ export class StringGuard extends BaseGuard {
|
|
|
116
157
|
]
|
|
117
158
|
});
|
|
118
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* @brief Add the built-in email string check.
|
|
162
|
+
* @returns Fresh StringGuard with an appended email check.
|
|
163
|
+
*/
|
|
164
|
+
email() {
|
|
165
|
+
const schema = readStringMethodSchema(this, "string email receiver");
|
|
166
|
+
return new StringGuard({
|
|
167
|
+
tag: SchemaTag.String,
|
|
168
|
+
checks: [
|
|
169
|
+
...schema.checks,
|
|
170
|
+
{
|
|
171
|
+
tag: StringCheckTag.Email
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* @brief Add the built-in URL string check.
|
|
178
|
+
* @returns Fresh StringGuard with an appended URL check.
|
|
179
|
+
* @details The check is a deterministic grammar subset rather than a
|
|
180
|
+
* throwing URL constructor call, so AOT and runtime validators agree.
|
|
181
|
+
*/
|
|
182
|
+
url() {
|
|
183
|
+
const schema = readStringMethodSchema(this, "string url receiver");
|
|
184
|
+
return new StringGuard({
|
|
185
|
+
tag: SchemaTag.String,
|
|
186
|
+
checks: [
|
|
187
|
+
...schema.checks,
|
|
188
|
+
{
|
|
189
|
+
tag: StringCheckTag.Url
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* @brief Add the built-in ISO date check.
|
|
196
|
+
* @returns Fresh StringGuard with an appended ISO date check.
|
|
197
|
+
*/
|
|
198
|
+
isoDate() {
|
|
199
|
+
const schema = readStringMethodSchema(this, "string isoDate receiver");
|
|
200
|
+
return new StringGuard({
|
|
201
|
+
tag: SchemaTag.String,
|
|
202
|
+
checks: [
|
|
203
|
+
...schema.checks,
|
|
204
|
+
{
|
|
205
|
+
tag: StringCheckTag.IsoDate
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @brief Add the built-in ISO date-time check.
|
|
212
|
+
* @returns Fresh StringGuard with an appended ISO date-time check.
|
|
213
|
+
*/
|
|
214
|
+
isoDateTime() {
|
|
215
|
+
const schema = readStringMethodSchema(this, "string isoDateTime receiver");
|
|
216
|
+
return new StringGuard({
|
|
217
|
+
tag: SchemaTag.String,
|
|
218
|
+
checks: [
|
|
219
|
+
...schema.checks,
|
|
220
|
+
{
|
|
221
|
+
tag: StringCheckTag.IsoDateTime
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @brief Add the built-in ULID string check.
|
|
228
|
+
* @returns Fresh StringGuard with an appended ULID check.
|
|
229
|
+
*/
|
|
230
|
+
ulid() {
|
|
231
|
+
const schema = readStringMethodSchema(this, "string ulid receiver");
|
|
232
|
+
return new StringGuard({
|
|
233
|
+
tag: SchemaTag.String,
|
|
234
|
+
checks: [
|
|
235
|
+
...schema.checks,
|
|
236
|
+
{
|
|
237
|
+
tag: StringCheckTag.Ulid
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* @brief Add the built-in IPv4 string check.
|
|
244
|
+
* @returns Fresh StringGuard with an appended IPv4 check.
|
|
245
|
+
*/
|
|
246
|
+
ipv4() {
|
|
247
|
+
const schema = readStringMethodSchema(this, "string ipv4 receiver");
|
|
248
|
+
return new StringGuard({
|
|
249
|
+
tag: SchemaTag.String,
|
|
250
|
+
checks: [
|
|
251
|
+
...schema.checks,
|
|
252
|
+
{
|
|
253
|
+
tag: StringCheckTag.Ipv4
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* @brief Add the built-in IPv6 string check.
|
|
260
|
+
* @returns Fresh StringGuard with an appended IPv6 check.
|
|
261
|
+
*/
|
|
262
|
+
ipv6() {
|
|
263
|
+
const schema = readStringMethodSchema(this, "string ipv6 receiver");
|
|
264
|
+
return new StringGuard({
|
|
265
|
+
tag: SchemaTag.String,
|
|
266
|
+
checks: [
|
|
267
|
+
...schema.checks,
|
|
268
|
+
{
|
|
269
|
+
tag: StringCheckTag.Ipv6
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* @brief Decode a string and trim surrounding whitespace.
|
|
276
|
+
* @returns Decoder that validates this string guard before trimming.
|
|
277
|
+
*/
|
|
278
|
+
trim() {
|
|
279
|
+
return transform(readRequiredStringGuard(this), (value) => trimString(value));
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* @brief Decode a string and lowercase it.
|
|
283
|
+
* @returns Decoder that validates this string guard before lowercasing.
|
|
284
|
+
*/
|
|
285
|
+
toLowerCase() {
|
|
286
|
+
return transform(readRequiredStringGuard(this), (value) => lowerString(value));
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* @brief Decode a string and uppercase it.
|
|
290
|
+
* @returns Decoder that validates this string guard before uppercasing.
|
|
291
|
+
*/
|
|
292
|
+
toUpperCase() {
|
|
293
|
+
return transform(readRequiredStringGuard(this), (value) => upperString(value));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* @brief Narrow a StringGuard receiver to its runtime string contract.
|
|
298
|
+
* @param guard StringGuard receiver after method dispatch.
|
|
299
|
+
* @returns The same guard seen as a required string source for decoder transforms.
|
|
300
|
+
*/
|
|
301
|
+
function readRequiredStringGuard(guard) {
|
|
302
|
+
return guard;
|
|
303
|
+
}
|
|
304
|
+
function trimString(value) {
|
|
305
|
+
return String.prototype.trim.call(value);
|
|
306
|
+
}
|
|
307
|
+
function lowerString(value) {
|
|
308
|
+
return String.prototype.toLowerCase.call(value);
|
|
309
|
+
}
|
|
310
|
+
function upperString(value) {
|
|
311
|
+
return String.prototype.toUpperCase.call(value);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* @brief Read a string argument used by fixed-string predicates.
|
|
315
|
+
* @param value Candidate substring value.
|
|
316
|
+
* @param label Method name used in thrown errors.
|
|
317
|
+
* @returns Accepted string value.
|
|
318
|
+
*/
|
|
319
|
+
function readStringNeedle(value, label) {
|
|
320
|
+
if (typeof value !== "string") {
|
|
321
|
+
throw new TypeError(`string ${label} value must be a string`);
|
|
322
|
+
}
|
|
323
|
+
return value;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* @brief Escape a literal string for RegExp source text.
|
|
327
|
+
* @param value String fragment to match literally.
|
|
328
|
+
* @returns RegExp source fragment with metacharacters escaped.
|
|
329
|
+
*/
|
|
330
|
+
function escapeRegExpString(value) {
|
|
331
|
+
return value.replace(/[\\^$.*+?()[\]{}|]/gu, "\\$&");
|
|
119
332
|
}
|
package/dist/guard/types.d.ts
CHANGED
|
@@ -75,6 +75,15 @@ export interface Guard<TValue, TPresence extends Presence = "required"> {
|
|
|
75
75
|
* @returns Check result with either the accepted value or frozen issues.
|
|
76
76
|
*/
|
|
77
77
|
check(value: unknown): CheckResult<RuntimeValue<TValue, TPresence>>;
|
|
78
|
+
/**
|
|
79
|
+
* @brief Validate a runtime value and keep only the first issue.
|
|
80
|
+
* @details This diagnostic path is intended for hot rejection checks where
|
|
81
|
+
* callers need one machine-readable failure and do not want full-tree issue
|
|
82
|
+
* collection. Success returns the original value with the guard's inferred type.
|
|
83
|
+
* @param value Candidate runtime value.
|
|
84
|
+
* @returns Check result with at most one frozen issue on failure.
|
|
85
|
+
*/
|
|
86
|
+
checkFirst(value: unknown): CheckResult<RuntimeValue<TValue, TPresence>>;
|
|
78
87
|
/**
|
|
79
88
|
* @brief Validate a runtime value or throw TypeSeaAssertionError.
|
|
80
89
|
* @details This convenience wrapper is intentionally explicit in the method
|
|
@@ -151,5 +160,14 @@ export interface Guard<TValue, TPresence extends Presence = "required"> {
|
|
|
151
160
|
* @returns Guard accepting only values accepted by both guards.
|
|
152
161
|
*/
|
|
153
162
|
intersect<TOther extends Guard<unknown, Presence>>(other: TOther): BaseGuard<RuntimeValue<TValue, TPresence> & Infer<TOther>>;
|
|
163
|
+
/**
|
|
164
|
+
* @brief Require one own data property after this guard succeeds.
|
|
165
|
+
* @details This is a safe property proof: only own data descriptors are
|
|
166
|
+
* accepted, so validation does not execute getters.
|
|
167
|
+
* @param key Own string property key to inspect.
|
|
168
|
+
* @param value Guard applied to the property value.
|
|
169
|
+
* @returns Guard carrying the base type plus the property proof.
|
|
170
|
+
*/
|
|
171
|
+
property<const TKey extends string, TGuard extends Guard<unknown, Presence>>(key: TKey, value: TGuard): BaseGuard<RuntimeValue<TValue, TPresence> & Readonly<Record<TKey, Infer<TGuard>>>>;
|
|
154
172
|
}
|
|
155
173
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/guard/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,CAAC,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AAE/C,MAAM,CAAC,OAAO,CAAC,MAAM,cAAc,EAAE,OAAO,MAAM,CAAC;AAEnD,MAAM,CAAC,OAAO,CAAC,MAAM,WAAW,EAAE,OAAO,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAE/C;;;;GA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optional, partial, pick, record, refine, strictObject, symbolGuard, tuple, union, unknownGuard, undefinedable, type InferObject, type InferTuple, type MergeObjectShapes, type ObjectGuardMode, type ObjectShape, type OmitObjectShape, ObjectGuard, type PartialObjectShape, type PickObjectShape, type TupleShape } from "./builders/index.js";
|
|
2
|
-
export { BaseGuard, NumberGuard, StringGuard, TypeSeaAssertionError, type Brand, type Guard, type GuardPresence, type GuardValue, type Infer, type Presence, type RuntimeValue } from "./guard/index.js";
|
|
1
|
+
export { t, array, bigintGuard, catchall, dateGuard, deepPartial, discriminatedUnion, enum, enumValues, extend, instanceOf, intersect, json, lazy, literal, map, merge, nullable, neverGuard, nullGuard, nullish, object, omit, optional, partial, passthrough, pick, property, record, refine, required, safeExtend, set, strict, strictObject, strip, symbolGuard, tuple, union, unknownGuard, undefinedGuard, undefinedable, voidGuard, type DeepPartialObjectShape, type DeepPartialValue, type InferObject, type InferTuple, type InferTupleWithRest, type EnumValues, type InstanceConstructor, type JsonValue, type MaskSelectedKeys, type MergeObjectShapes, type ObjectKeyMask, type ObjectGuardMode, type ObjectShape, type OmitObjectShape, type OmitObjectShapeByMask, ObjectGuard, type PartialObjectShape, type PickObjectShape, type PickObjectShapeByMask, type RequiredObjectShape, type TupleShape } from "./builders/index.js";
|
|
2
|
+
export { BaseGuard, ArrayGuard, DateGuard, NumberGuard, StringGuard, TypeSeaAssertionError, type Brand, type Guard, type GuardPresence, type GuardValue, type Infer, type Presence, type RuntimeValue } from "./guard/index.js";
|
|
3
3
|
export { CompiledBaseGuard, compile, type CompileMode, type CompileOptions, type CompiledGuard } from "./compile/index.js";
|
|
4
4
|
export { emitAotModule, type AotCompileOptions, type AotIssue, type AotIssueCode, type AotModule } from "./aot/index.js";
|
|
5
5
|
export { toAsyncTrpcParser, toFastifyRouteSchema, toFastifyValidatorCompiler, toReactHookFormResolver, toTrpcParser, type AsyncTrpcParser, type FastifyHttpPart, type FastifyRouteSchema, type FastifyRouteSchemaOptions, type FastifyValidationResult, type FastifyValidator, type FastifyValidatorCompiler, type FastifyValidatorCompilerSource, type FastifyValidatorCompilerSourceMap, type FastifyValidatorRoute, type InferAdapter, type InferSyncAdapter, type ReactHookFormErrors, type ReactHookFormFieldError, type ReactHookFormResolver, type ReactHookFormResolverOptions, type ReactHookFormResolverResult, type SyncAdapterSource, type TrpcParser } from "./adapters/index.js";
|
|
6
6
|
export { BaseAsyncDecoder, asyncDecoder, asyncPipe, asyncRefine, asyncTransform, isAsyncDecoderValue, type AsyncDecodeSource, type AsyncDecoder, type InferAsyncDecoder } from "./async/index.js";
|
|
7
|
-
export { BaseDecoder, coerce, coerceBoolean, coerceNumber, coerceString, decoder, isDecoderValue, pipe, transform, type DecodeSource, type Decoder, type InferDecoder } from "./decoder/index.js";
|
|
7
|
+
export { BaseCodec, BaseDecoder, catchValue, codec, coerce, coerceBoolean, coerceNumber, coerceString, defaultValue, decoder, isCodecValue, isDecoderValue, pipe, prefault, transform, type Codec, type DecodeSource, type Decoder, type InferDecoder } from "./decoder/index.js";
|
|
8
8
|
export { schemaToJsonSchema, toJsonSchema, type JsonSchema, type JsonSchemaExportCode, type JsonSchemaExportIssue, type JsonSchemaObject, type JsonSchemaOptions, type JsonSchemaPrimitive, type JsonSchemaTypeName } from "./json-schema/index.js";
|
|
9
|
-
export { defineMessages, formatIssue, formatIssues, withMessages, type IssueMessageCatalog, type IssueMessageContext, type IssueMessageFormatter, type IssueMessageOptions, type IssueMessageTemplate, type MessageLocale } from "./message/index.js";
|
|
9
|
+
export { defineMessages, flattenIssues, formatIssue, formatIssues, withMessages, type FlattenedIssueMessages, type IssueMessageCatalog, type IssueMessageContext, type IssueMessageFormatter, type IssueMessageOptions, type IssueMessageTemplate, type MessageLocale } from "./message/index.js";
|
|
10
10
|
export type { CheckResult, Issue, IssueCode, PathSegment } from "./issue/index.js";
|
|
11
11
|
export type { Graph, GraphNode, NodeId } from "./ir/index.js";
|
|
12
12
|
export { optimizeGraph } from "./optimize/index.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,CAAC,EACD,KAAK,EACL,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,MAAM,EACN,MAAM,EACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,UAAU,EAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,SAAS,EACT,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,KAAK,KAAK,EACV,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACH,iBAAiB,EACjB,OAAO,EACP,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACH,aAAa,EACb,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,SAAS,EACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,iBAAiB,EACjB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK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EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,CAAC,EACD,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,IAAI,EACJ,UAAU,EACV,MAAM,EACN,UAAU,EACV,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,GAAG,EACH,KAAK,EACL,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,GAAG,EACH,MAAM,EACN,YAAY,EACZ,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,KAAK,KAAK,EACV,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,K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