valrs 0.1.0
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/README.md +197 -0
- package/dist/compiler.d.ts +195 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +349 -0
- package/dist/compiler.js.map +1 -0
- package/dist/error.d.ts +415 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +619 -0
- package/dist/error.js.map +1 -0
- package/dist/factory.d.ts +107 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +135 -0
- package/dist/factory.js.map +1 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives.d.ts +99 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +315 -0
- package/dist/primitives.js.map +1 -0
- package/dist/schema.d.ts +710 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +1179 -0
- package/dist/schema.js.map +1 -0
- package/dist/streaming.d.ts +159 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/streaming.js +692 -0
- package/dist/streaming.js.map +1 -0
- package/dist/types.d.ts +107 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/dist/v.d.ts +1382 -0
- package/dist/v.d.ts.map +1 -0
- package/dist/v.js +2396 -0
- package/dist/v.js.map +1 -0
- package/dist/wasm.d.ts +86 -0
- package/dist/wasm.d.ts.map +1 -0
- package/dist/wasm.js +87 -0
- package/dist/wasm.js.map +1 -0
- package/package.json +89 -0
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ValError - Zod-compatible error class for validation failures.
|
|
3
|
+
*
|
|
4
|
+
* Thrown by `schema.parse()` when validation fails.
|
|
5
|
+
* Contains detailed information about all validation issues with
|
|
6
|
+
* Zod-compatible error codes and formatting methods.
|
|
7
|
+
*/
|
|
8
|
+
import type { ValidationIssue } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* All possible Zod-compatible validation error codes.
|
|
11
|
+
*/
|
|
12
|
+
export type ValIssueCode = 'invalid_type' | 'invalid_literal' | 'custom' | 'invalid_union' | 'invalid_union_discriminator' | 'invalid_enum_value' | 'unrecognized_keys' | 'invalid_arguments' | 'invalid_return_type' | 'invalid_date' | 'invalid_string' | 'too_small' | 'too_big' | 'invalid_intersection_types' | 'not_multiple_of' | 'not_finite';
|
|
13
|
+
/**
|
|
14
|
+
* Base interface for all validation issues.
|
|
15
|
+
*/
|
|
16
|
+
export interface ValIssueBase {
|
|
17
|
+
readonly code: ValIssueCode;
|
|
18
|
+
readonly path: ReadonlyArray<string | number>;
|
|
19
|
+
readonly message: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Issue for type validation failures.
|
|
23
|
+
*/
|
|
24
|
+
export interface InvalidTypeIssue extends ValIssueBase {
|
|
25
|
+
readonly code: 'invalid_type';
|
|
26
|
+
readonly expected: string;
|
|
27
|
+
readonly received: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Issue for literal value validation failures.
|
|
31
|
+
*/
|
|
32
|
+
export interface InvalidLiteralIssue extends ValIssueBase {
|
|
33
|
+
readonly code: 'invalid_literal';
|
|
34
|
+
readonly expected: unknown;
|
|
35
|
+
readonly received: unknown;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Issue for custom validation failures.
|
|
39
|
+
*/
|
|
40
|
+
export interface CustomIssue extends ValIssueBase {
|
|
41
|
+
readonly code: 'custom';
|
|
42
|
+
readonly params?: Record<string, unknown> | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Issue for union validation failures.
|
|
46
|
+
*/
|
|
47
|
+
export interface InvalidUnionIssue extends ValIssueBase {
|
|
48
|
+
readonly code: 'invalid_union';
|
|
49
|
+
readonly unionErrors: ReadonlyArray<ValError>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Issue for discriminated union validation failures.
|
|
53
|
+
*/
|
|
54
|
+
export interface InvalidUnionDiscriminatorIssue extends ValIssueBase {
|
|
55
|
+
readonly code: 'invalid_union_discriminator';
|
|
56
|
+
readonly options: ReadonlyArray<string | number>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Issue for enum validation failures.
|
|
60
|
+
*/
|
|
61
|
+
export interface InvalidEnumValueIssue extends ValIssueBase {
|
|
62
|
+
readonly code: 'invalid_enum_value';
|
|
63
|
+
readonly options: ReadonlyArray<string | number>;
|
|
64
|
+
readonly received: unknown;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Issue for unrecognized object keys.
|
|
68
|
+
*/
|
|
69
|
+
export interface UnrecognizedKeysIssue extends ValIssueBase {
|
|
70
|
+
readonly code: 'unrecognized_keys';
|
|
71
|
+
readonly keys: ReadonlyArray<string>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Issue for invalid function arguments.
|
|
75
|
+
*/
|
|
76
|
+
export interface InvalidArgumentsIssue extends ValIssueBase {
|
|
77
|
+
readonly code: 'invalid_arguments';
|
|
78
|
+
readonly argumentsError: ValError;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Issue for invalid function return type.
|
|
82
|
+
*/
|
|
83
|
+
export interface InvalidReturnTypeIssue extends ValIssueBase {
|
|
84
|
+
readonly code: 'invalid_return_type';
|
|
85
|
+
readonly returnTypeError: ValError;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Issue for invalid Date values.
|
|
89
|
+
*/
|
|
90
|
+
export interface InvalidDateIssue extends ValIssueBase {
|
|
91
|
+
readonly code: 'invalid_date';
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* String validation type for too_small/too_big.
|
|
95
|
+
*/
|
|
96
|
+
export type StringValidation = 'email' | 'url' | 'emoji' | 'uuid' | 'cuid' | 'cuid2' | 'ulid' | 'regex' | 'datetime' | 'ip' | 'base64';
|
|
97
|
+
/**
|
|
98
|
+
* Issue for invalid string format.
|
|
99
|
+
*/
|
|
100
|
+
export interface InvalidStringIssue extends ValIssueBase {
|
|
101
|
+
readonly code: 'invalid_string';
|
|
102
|
+
readonly validation: StringValidation | {
|
|
103
|
+
readonly includes: string;
|
|
104
|
+
readonly position?: number;
|
|
105
|
+
} | {
|
|
106
|
+
readonly startsWith: string;
|
|
107
|
+
} | {
|
|
108
|
+
readonly endsWith: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Constraint type for size validation.
|
|
113
|
+
*/
|
|
114
|
+
export type SizeType = 'string' | 'number' | 'array' | 'set' | 'date' | 'bigint';
|
|
115
|
+
/**
|
|
116
|
+
* Issue for values that are too small.
|
|
117
|
+
*/
|
|
118
|
+
export interface TooSmallIssue extends ValIssueBase {
|
|
119
|
+
readonly code: 'too_small';
|
|
120
|
+
readonly type: SizeType;
|
|
121
|
+
readonly minimum: number | bigint;
|
|
122
|
+
readonly inclusive: boolean;
|
|
123
|
+
readonly exact?: boolean | undefined;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Issue for values that are too big.
|
|
127
|
+
*/
|
|
128
|
+
export interface TooBigIssue extends ValIssueBase {
|
|
129
|
+
readonly code: 'too_big';
|
|
130
|
+
readonly type: SizeType;
|
|
131
|
+
readonly maximum: number | bigint;
|
|
132
|
+
readonly inclusive: boolean;
|
|
133
|
+
readonly exact?: boolean | undefined;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Issue for intersection type validation failures.
|
|
137
|
+
*/
|
|
138
|
+
export interface InvalidIntersectionTypesIssue extends ValIssueBase {
|
|
139
|
+
readonly code: 'invalid_intersection_types';
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Issue for values that are not a multiple of a given number.
|
|
143
|
+
*/
|
|
144
|
+
export interface NotMultipleOfIssue extends ValIssueBase {
|
|
145
|
+
readonly code: 'not_multiple_of';
|
|
146
|
+
readonly multipleOf: number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Issue for non-finite number values.
|
|
150
|
+
*/
|
|
151
|
+
export interface NotFiniteIssue extends ValIssueBase {
|
|
152
|
+
readonly code: 'not_finite';
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Union of all issue types.
|
|
156
|
+
*/
|
|
157
|
+
export type ValIssue = InvalidTypeIssue | InvalidLiteralIssue | CustomIssue | InvalidUnionIssue | InvalidUnionDiscriminatorIssue | InvalidEnumValueIssue | UnrecognizedKeysIssue | InvalidArgumentsIssue | InvalidReturnTypeIssue | InvalidDateIssue | InvalidStringIssue | TooSmallIssue | TooBigIssue | InvalidIntersectionTypesIssue | NotMultipleOfIssue | NotFiniteIssue;
|
|
158
|
+
/**
|
|
159
|
+
* Context provided to error map functions.
|
|
160
|
+
*/
|
|
161
|
+
export interface ErrorMapContext {
|
|
162
|
+
readonly defaultError: string;
|
|
163
|
+
readonly data: unknown;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Function type for custom error messages.
|
|
167
|
+
*/
|
|
168
|
+
export type ErrorMapFn = (issue: ValIssue, ctx: ErrorMapContext) => string;
|
|
169
|
+
/**
|
|
170
|
+
* Options for schema-level error customization.
|
|
171
|
+
*/
|
|
172
|
+
export interface SchemaErrorOptions {
|
|
173
|
+
readonly errorMap?: ErrorMapFn;
|
|
174
|
+
readonly message?: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Sets the global error map for all validations.
|
|
178
|
+
*
|
|
179
|
+
* @param errorMap - Function to generate custom error messages
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* v.setErrorMap((issue, ctx) => {
|
|
184
|
+
* if (issue.code === 'invalid_type') {
|
|
185
|
+
* return `Expected ${issue.expected}, got ${issue.received}`;
|
|
186
|
+
* }
|
|
187
|
+
* return ctx.defaultError;
|
|
188
|
+
* });
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
export declare function setErrorMap(errorMap: ErrorMapFn | undefined): void;
|
|
192
|
+
/**
|
|
193
|
+
* Gets the current global error map.
|
|
194
|
+
*/
|
|
195
|
+
export declare function getErrorMap(): ErrorMapFn | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* Resets the global error map to undefined.
|
|
198
|
+
*/
|
|
199
|
+
export declare function resetErrorMap(): void;
|
|
200
|
+
/**
|
|
201
|
+
* Gets the JavaScript type of a value as a string.
|
|
202
|
+
*/
|
|
203
|
+
export declare function getTypeName(value: unknown): string;
|
|
204
|
+
/**
|
|
205
|
+
* Creates an invalid_type issue.
|
|
206
|
+
*/
|
|
207
|
+
export declare function createInvalidTypeIssue(expected: string, received: unknown, path?: ReadonlyArray<string | number>, message?: string): InvalidTypeIssue;
|
|
208
|
+
/**
|
|
209
|
+
* Creates a too_small issue.
|
|
210
|
+
*/
|
|
211
|
+
export declare function createTooSmallIssue(type: SizeType, minimum: number | bigint, inclusive: boolean, path?: ReadonlyArray<string | number>, message?: string, exact?: boolean): TooSmallIssue;
|
|
212
|
+
/**
|
|
213
|
+
* Creates a too_big issue.
|
|
214
|
+
*/
|
|
215
|
+
export declare function createTooBigIssue(type: SizeType, maximum: number | bigint, inclusive: boolean, path?: ReadonlyArray<string | number>, message?: string, exact?: boolean): TooBigIssue;
|
|
216
|
+
/**
|
|
217
|
+
* Creates an invalid_string issue.
|
|
218
|
+
*/
|
|
219
|
+
export declare function createInvalidStringIssue(validation: InvalidStringIssue['validation'], path?: ReadonlyArray<string | number>, message?: string): InvalidStringIssue;
|
|
220
|
+
/**
|
|
221
|
+
* Creates an invalid_enum_value issue.
|
|
222
|
+
*/
|
|
223
|
+
export declare function createInvalidEnumValueIssue(options: ReadonlyArray<string | number>, received: unknown, path?: ReadonlyArray<string | number>, message?: string): InvalidEnumValueIssue;
|
|
224
|
+
/**
|
|
225
|
+
* Creates an invalid_union issue.
|
|
226
|
+
*/
|
|
227
|
+
export declare function createInvalidUnionIssue(unionErrors: ReadonlyArray<ValError>, path?: ReadonlyArray<string | number>, message?: string): InvalidUnionIssue;
|
|
228
|
+
/**
|
|
229
|
+
* Creates an unrecognized_keys issue.
|
|
230
|
+
*/
|
|
231
|
+
export declare function createUnrecognizedKeysIssue(keys: ReadonlyArray<string>, path?: ReadonlyArray<string | number>, message?: string): UnrecognizedKeysIssue;
|
|
232
|
+
/**
|
|
233
|
+
* Creates a custom issue.
|
|
234
|
+
*/
|
|
235
|
+
export declare function createCustomIssue(message: string, path?: ReadonlyArray<string | number>, params?: Record<string, unknown>): CustomIssue;
|
|
236
|
+
/**
|
|
237
|
+
* Creates an invalid_literal issue.
|
|
238
|
+
*/
|
|
239
|
+
export declare function createInvalidLiteralIssue(expected: unknown, received: unknown, path?: ReadonlyArray<string | number>, message?: string): InvalidLiteralIssue;
|
|
240
|
+
/**
|
|
241
|
+
* Creates a not_multiple_of issue.
|
|
242
|
+
*/
|
|
243
|
+
export declare function createNotMultipleOfIssue(multipleOf: number, path?: ReadonlyArray<string | number>, message?: string): NotMultipleOfIssue;
|
|
244
|
+
/**
|
|
245
|
+
* Creates a not_finite issue.
|
|
246
|
+
*/
|
|
247
|
+
export declare function createNotFiniteIssue(path?: ReadonlyArray<string | number>, message?: string): NotFiniteIssue;
|
|
248
|
+
/**
|
|
249
|
+
* Creates an invalid_date issue.
|
|
250
|
+
*/
|
|
251
|
+
export declare function createInvalidDateIssue(path?: ReadonlyArray<string | number>, message?: string): InvalidDateIssue;
|
|
252
|
+
/**
|
|
253
|
+
* Type for the nested error format returned by format().
|
|
254
|
+
*/
|
|
255
|
+
export type FormattedError<T = unknown> = {
|
|
256
|
+
_errors: string[];
|
|
257
|
+
} & (T extends object ? {
|
|
258
|
+
[K in keyof T]?: FormattedError<T[K]>;
|
|
259
|
+
} : unknown);
|
|
260
|
+
/**
|
|
261
|
+
* Type for the flattened error format returned by flatten().
|
|
262
|
+
*/
|
|
263
|
+
export interface FlattenedError<T = unknown> {
|
|
264
|
+
formErrors: string[];
|
|
265
|
+
fieldErrors: T extends object ? {
|
|
266
|
+
[K in keyof T]?: string[];
|
|
267
|
+
} : {
|
|
268
|
+
[key: string]: string[];
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Error thrown when `schema.parse()` fails.
|
|
273
|
+
*
|
|
274
|
+
* Contains an array of issues describing all validation failures
|
|
275
|
+
* with Zod-compatible error codes and formatting methods.
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```typescript
|
|
279
|
+
* try {
|
|
280
|
+
* v.string().parse(123);
|
|
281
|
+
* } catch (error) {
|
|
282
|
+
* if (error instanceof ValError) {
|
|
283
|
+
* console.log(error.issues);
|
|
284
|
+
* // [{ code: 'invalid_type', path: [], message: 'Expected string, received number', ... }]
|
|
285
|
+
*
|
|
286
|
+
* console.log(error.format());
|
|
287
|
+
* // { _errors: ['Expected string, received number'] }
|
|
288
|
+
*
|
|
289
|
+
* console.log(error.flatten());
|
|
290
|
+
* // { formErrors: ['Expected string, received number'], fieldErrors: {} }
|
|
291
|
+
* }
|
|
292
|
+
* }
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
export declare class ValError extends Error {
|
|
296
|
+
/** The name of this error class. */
|
|
297
|
+
readonly name = "ValError";
|
|
298
|
+
/** All validation issues that caused this error. */
|
|
299
|
+
readonly issues: ReadonlyArray<ValIssue>;
|
|
300
|
+
/**
|
|
301
|
+
* Creates a new ValError from an array of validation issues.
|
|
302
|
+
*/
|
|
303
|
+
constructor(issues: ReadonlyArray<ValidationIssue>);
|
|
304
|
+
/**
|
|
305
|
+
* Creates a ValError directly from ValIssue array (no conversion needed).
|
|
306
|
+
*/
|
|
307
|
+
static fromValIssues(issues: ReadonlyArray<ValIssue>): ValError;
|
|
308
|
+
/**
|
|
309
|
+
* Formats the validation issues into a human-readable error message.
|
|
310
|
+
*/
|
|
311
|
+
private static formatMessage;
|
|
312
|
+
/**
|
|
313
|
+
* Gets the first validation issue, if any.
|
|
314
|
+
*/
|
|
315
|
+
get firstError(): ValIssue | undefined;
|
|
316
|
+
/**
|
|
317
|
+
* Checks if there are errors at the specified path.
|
|
318
|
+
*
|
|
319
|
+
* @param path - Array of path segments to check
|
|
320
|
+
* @returns true if there are errors at the specified path
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```typescript
|
|
324
|
+
* error.hasErrorAt(['user', 'email']);
|
|
325
|
+
* error.hasErrorAt(['items', 0, 'name']);
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
hasErrorAt(path: ReadonlyArray<string | number>): boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Gets all errors at the specified path.
|
|
331
|
+
*
|
|
332
|
+
* @param path - Array of path segments to check
|
|
333
|
+
* @returns Array of issues at the specified path
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```typescript
|
|
337
|
+
* const emailErrors = error.errorsAt(['user', 'email']);
|
|
338
|
+
* const itemErrors = error.errorsAt(['items', 0]);
|
|
339
|
+
* ```
|
|
340
|
+
*/
|
|
341
|
+
errorsAt(path: ReadonlyArray<string | number>): ReadonlyArray<ValIssue>;
|
|
342
|
+
/**
|
|
343
|
+
* Checks if two paths match exactly.
|
|
344
|
+
*/
|
|
345
|
+
private pathsMatch;
|
|
346
|
+
/**
|
|
347
|
+
* Formats errors as a nested object matching the path structure.
|
|
348
|
+
*
|
|
349
|
+
* Each level has an `_errors` array containing error messages at that level.
|
|
350
|
+
* Nested objects/arrays have their own nested structures.
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```typescript
|
|
354
|
+
* const error = new ValError([
|
|
355
|
+
* { message: 'Required', path: ['user', 'name'], code: 'custom' },
|
|
356
|
+
* { message: 'Invalid email', path: ['user', 'email'], code: 'custom' },
|
|
357
|
+
* ]);
|
|
358
|
+
*
|
|
359
|
+
* error.format();
|
|
360
|
+
* // {
|
|
361
|
+
* // _errors: [],
|
|
362
|
+
* // user: {
|
|
363
|
+
* // _errors: [],
|
|
364
|
+
* // name: { _errors: ['Required'] },
|
|
365
|
+
* // email: { _errors: ['Invalid email'] },
|
|
366
|
+
* // }
|
|
367
|
+
* // }
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
format<T = unknown>(): FormattedError<T>;
|
|
371
|
+
/**
|
|
372
|
+
* Flattens the issues into a simple object mapping paths to error messages.
|
|
373
|
+
*
|
|
374
|
+
* Form-level errors (no path) go into `formErrors`.
|
|
375
|
+
* Field-level errors go into `fieldErrors` with dot-notation keys.
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```typescript
|
|
379
|
+
* const error = new ValError([
|
|
380
|
+
* { message: 'Required', path: ['user', 'name'], code: 'custom' },
|
|
381
|
+
* { message: 'Invalid email', path: ['user', 'email'], code: 'custom' },
|
|
382
|
+
* { message: 'Form error', path: [], code: 'custom' },
|
|
383
|
+
* ]);
|
|
384
|
+
*
|
|
385
|
+
* error.flatten();
|
|
386
|
+
* // {
|
|
387
|
+
* // formErrors: ['Form error'],
|
|
388
|
+
* // fieldErrors: {
|
|
389
|
+
* // 'user.name': ['Required'],
|
|
390
|
+
* // 'user.email': ['Invalid email'],
|
|
391
|
+
* // }
|
|
392
|
+
* // }
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
flatten<T = unknown>(): FlattenedError<T>;
|
|
396
|
+
/**
|
|
397
|
+
* Returns a human-readable string representation of the error.
|
|
398
|
+
*/
|
|
399
|
+
toString(): string;
|
|
400
|
+
/**
|
|
401
|
+
* Adds a new issue to a copy of this error.
|
|
402
|
+
* Returns a new ValError instance.
|
|
403
|
+
*/
|
|
404
|
+
addIssue(issue: ValIssue): ValError;
|
|
405
|
+
/**
|
|
406
|
+
* Adds issues from another ValError to a copy of this error.
|
|
407
|
+
* Returns a new ValError instance.
|
|
408
|
+
*/
|
|
409
|
+
addIssues(issues: ReadonlyArray<ValIssue>): ValError;
|
|
410
|
+
/**
|
|
411
|
+
* Checks if this is a ValError instance.
|
|
412
|
+
*/
|
|
413
|
+
static isValError(value: unknown): value is ValError;
|
|
414
|
+
}
|
|
415
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,SAAS,CAAC;AAM5D;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,iBAAiB,GACjB,QAAQ,GACR,eAAe,GACf,6BAA6B,GAC7B,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,SAAS,GACT,4BAA4B,GAC5B,iBAAiB,GACjB,YAAY,CAAC;AAMjB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,W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