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/dist/error.js ADDED
@@ -0,0 +1,619 @@
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
+ // ============================================================================
9
+ // Global Error Map
10
+ // ============================================================================
11
+ let globalErrorMap;
12
+ /**
13
+ * Sets the global error map for all validations.
14
+ *
15
+ * @param errorMap - Function to generate custom error messages
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * v.setErrorMap((issue, ctx) => {
20
+ * if (issue.code === 'invalid_type') {
21
+ * return `Expected ${issue.expected}, got ${issue.received}`;
22
+ * }
23
+ * return ctx.defaultError;
24
+ * });
25
+ * ```
26
+ */
27
+ export function setErrorMap(errorMap) {
28
+ globalErrorMap = errorMap;
29
+ }
30
+ /**
31
+ * Gets the current global error map.
32
+ */
33
+ export function getErrorMap() {
34
+ return globalErrorMap;
35
+ }
36
+ /**
37
+ * Resets the global error map to undefined.
38
+ */
39
+ export function resetErrorMap() {
40
+ globalErrorMap = undefined;
41
+ }
42
+ // ============================================================================
43
+ // Issue Creation Helpers
44
+ // ============================================================================
45
+ /**
46
+ * Gets the JavaScript type of a value as a string.
47
+ */
48
+ export function getTypeName(value) {
49
+ if (value === null)
50
+ return 'null';
51
+ if (value === undefined)
52
+ return 'undefined';
53
+ if (Array.isArray(value))
54
+ return 'array';
55
+ if (value instanceof Date)
56
+ return 'date';
57
+ if (value instanceof Map)
58
+ return 'map';
59
+ if (value instanceof Set)
60
+ return 'set';
61
+ if (typeof value === 'bigint')
62
+ return 'bigint';
63
+ if (typeof value === 'symbol')
64
+ return 'symbol';
65
+ if (typeof value === 'function')
66
+ return 'function';
67
+ return typeof value;
68
+ }
69
+ /**
70
+ * Creates an invalid_type issue.
71
+ */
72
+ export function createInvalidTypeIssue(expected, received, path = [], message) {
73
+ const receivedType = getTypeName(received);
74
+ return {
75
+ code: 'invalid_type',
76
+ expected,
77
+ received: receivedType,
78
+ path,
79
+ message: message ?? `Expected ${expected}, received ${receivedType}`,
80
+ };
81
+ }
82
+ /**
83
+ * Creates a too_small issue.
84
+ */
85
+ export function createTooSmallIssue(type, minimum, inclusive, path = [], message, exact) {
86
+ const defaultMessage = exact
87
+ ? `${type === 'string' ? 'String' : type === 'array' ? 'Array' : 'Value'} must be exactly ${minimum}`
88
+ : inclusive
89
+ ? `${type === 'string' ? 'String' : type === 'array' ? 'Array' : 'Value'} must be at least ${minimum}`
90
+ : `${type === 'string' ? 'String' : type === 'array' ? 'Array' : 'Value'} must be greater than ${minimum}`;
91
+ return {
92
+ code: 'too_small',
93
+ type,
94
+ minimum,
95
+ inclusive,
96
+ exact,
97
+ path,
98
+ message: message ?? defaultMessage,
99
+ };
100
+ }
101
+ /**
102
+ * Creates a too_big issue.
103
+ */
104
+ export function createTooBigIssue(type, maximum, inclusive, path = [], message, exact) {
105
+ const defaultMessage = exact
106
+ ? `${type === 'string' ? 'String' : type === 'array' ? 'Array' : 'Value'} must be exactly ${maximum}`
107
+ : inclusive
108
+ ? `${type === 'string' ? 'String' : type === 'array' ? 'Array' : 'Value'} must be at most ${maximum}`
109
+ : `${type === 'string' ? 'String' : type === 'array' ? 'Array' : 'Value'} must be less than ${maximum}`;
110
+ return {
111
+ code: 'too_big',
112
+ type,
113
+ maximum,
114
+ inclusive,
115
+ exact,
116
+ path,
117
+ message: message ?? defaultMessage,
118
+ };
119
+ }
120
+ /**
121
+ * Creates an invalid_string issue.
122
+ */
123
+ export function createInvalidStringIssue(validation, path = [], message) {
124
+ let defaultMessage;
125
+ if (typeof validation === 'string') {
126
+ defaultMessage = `Invalid ${validation}`;
127
+ }
128
+ else if ('includes' in validation) {
129
+ defaultMessage = `String must include "${validation.includes}"`;
130
+ }
131
+ else if ('startsWith' in validation) {
132
+ defaultMessage = `String must start with "${validation.startsWith}"`;
133
+ }
134
+ else {
135
+ defaultMessage = `String must end with "${validation.endsWith}"`;
136
+ }
137
+ return {
138
+ code: 'invalid_string',
139
+ validation,
140
+ path,
141
+ message: message ?? defaultMessage,
142
+ };
143
+ }
144
+ /**
145
+ * Creates an invalid_enum_value issue.
146
+ */
147
+ export function createInvalidEnumValueIssue(options, received, path = [], message) {
148
+ return {
149
+ code: 'invalid_enum_value',
150
+ options,
151
+ received,
152
+ path,
153
+ message: message ?? `Invalid enum value. Expected ${options.map(o => JSON.stringify(o)).join(' | ')}, received ${JSON.stringify(received)}`,
154
+ };
155
+ }
156
+ /**
157
+ * Creates an invalid_union issue.
158
+ */
159
+ export function createInvalidUnionIssue(unionErrors, path = [], message) {
160
+ return {
161
+ code: 'invalid_union',
162
+ unionErrors,
163
+ path,
164
+ message: message ?? 'Invalid union: none of the variants matched',
165
+ };
166
+ }
167
+ /**
168
+ * Creates an unrecognized_keys issue.
169
+ */
170
+ export function createUnrecognizedKeysIssue(keys, path = [], message) {
171
+ return {
172
+ code: 'unrecognized_keys',
173
+ keys,
174
+ path,
175
+ message: message ?? `Unrecognized key(s) in object: ${keys.map(k => `'${k}'`).join(', ')}`,
176
+ };
177
+ }
178
+ /**
179
+ * Creates a custom issue.
180
+ */
181
+ export function createCustomIssue(message, path = [], params) {
182
+ return {
183
+ code: 'custom',
184
+ path,
185
+ message,
186
+ params,
187
+ };
188
+ }
189
+ /**
190
+ * Creates an invalid_literal issue.
191
+ */
192
+ export function createInvalidLiteralIssue(expected, received, path = [], message) {
193
+ return {
194
+ code: 'invalid_literal',
195
+ expected,
196
+ received,
197
+ path,
198
+ message: message ?? `Invalid literal value, expected ${JSON.stringify(expected)}`,
199
+ };
200
+ }
201
+ /**
202
+ * Creates a not_multiple_of issue.
203
+ */
204
+ export function createNotMultipleOfIssue(multipleOf, path = [], message) {
205
+ return {
206
+ code: 'not_multiple_of',
207
+ multipleOf,
208
+ path,
209
+ message: message ?? `Number must be a multiple of ${multipleOf}`,
210
+ };
211
+ }
212
+ /**
213
+ * Creates a not_finite issue.
214
+ */
215
+ export function createNotFiniteIssue(path = [], message) {
216
+ return {
217
+ code: 'not_finite',
218
+ path,
219
+ message: message ?? 'Number must be finite',
220
+ };
221
+ }
222
+ /**
223
+ * Creates an invalid_date issue.
224
+ */
225
+ export function createInvalidDateIssue(path = [], message) {
226
+ return {
227
+ code: 'invalid_date',
228
+ path,
229
+ message: message ?? 'Invalid date',
230
+ };
231
+ }
232
+ // ============================================================================
233
+ // Path Normalization
234
+ // ============================================================================
235
+ /**
236
+ * Normalizes a path segment to a simple string or number.
237
+ */
238
+ function normalizePathSegment(segment) {
239
+ if (typeof segment === 'object' && segment !== null && 'key' in segment) {
240
+ return segment.key;
241
+ }
242
+ return segment;
243
+ }
244
+ /**
245
+ * Converts a ValidationIssue from Standard Schema format to ValIssue format.
246
+ */
247
+ function toValIssue(issue) {
248
+ const path = issue.path?.map(normalizePathSegment) ?? [];
249
+ const code = issue.code ?? 'custom';
250
+ // Handle structured issues that already have Zod-compatible format
251
+ if (code === 'invalid_type' && 'expected' in issue && 'received' in issue) {
252
+ return {
253
+ code: 'invalid_type',
254
+ expected: String(issue['expected']),
255
+ received: String(issue['received']),
256
+ path,
257
+ message: issue.message,
258
+ };
259
+ }
260
+ if (code === 'too_small' && 'type' in issue && 'minimum' in issue) {
261
+ return {
262
+ code: 'too_small',
263
+ type: issue['type'],
264
+ minimum: issue['minimum'],
265
+ inclusive: issue['inclusive'] ?? true,
266
+ exact: issue['exact'],
267
+ path,
268
+ message: issue.message,
269
+ };
270
+ }
271
+ if (code === 'too_big' && 'type' in issue && 'maximum' in issue) {
272
+ return {
273
+ code: 'too_big',
274
+ type: issue['type'],
275
+ maximum: issue['maximum'],
276
+ inclusive: issue['inclusive'] ?? true,
277
+ exact: issue['exact'],
278
+ path,
279
+ message: issue.message,
280
+ };
281
+ }
282
+ if (code === 'invalid_string' && 'validation' in issue) {
283
+ return {
284
+ code: 'invalid_string',
285
+ validation: issue['validation'],
286
+ path,
287
+ message: issue.message,
288
+ };
289
+ }
290
+ if (code === 'invalid_enum_value' && 'options' in issue) {
291
+ return {
292
+ code: 'invalid_enum_value',
293
+ options: issue['options'],
294
+ received: issue['received'],
295
+ path,
296
+ message: issue.message,
297
+ };
298
+ }
299
+ if (code === 'invalid_union' && 'unionErrors' in issue) {
300
+ return {
301
+ code: 'invalid_union',
302
+ unionErrors: issue['unionErrors'],
303
+ path,
304
+ message: issue.message,
305
+ };
306
+ }
307
+ if (code === 'unrecognized_keys' && 'keys' in issue) {
308
+ return {
309
+ code: 'unrecognized_keys',
310
+ keys: issue['keys'],
311
+ path,
312
+ message: issue.message,
313
+ };
314
+ }
315
+ if (code === 'invalid_literal' && 'expected' in issue) {
316
+ return {
317
+ code: 'invalid_literal',
318
+ expected: issue['expected'],
319
+ received: issue['received'],
320
+ path,
321
+ message: issue.message,
322
+ };
323
+ }
324
+ if (code === 'not_multiple_of' && 'multipleOf' in issue) {
325
+ return {
326
+ code: 'not_multiple_of',
327
+ multipleOf: issue['multipleOf'],
328
+ path,
329
+ message: issue.message,
330
+ };
331
+ }
332
+ if (code === 'not_finite') {
333
+ return {
334
+ code: 'not_finite',
335
+ path,
336
+ message: issue.message,
337
+ };
338
+ }
339
+ if (code === 'invalid_date') {
340
+ return {
341
+ code: 'invalid_date',
342
+ path,
343
+ message: issue.message,
344
+ };
345
+ }
346
+ if (code === 'invalid_union_discriminator' && 'options' in issue) {
347
+ return {
348
+ code: 'invalid_union_discriminator',
349
+ options: issue['options'],
350
+ path,
351
+ message: issue.message,
352
+ };
353
+ }
354
+ // Default to custom issue
355
+ return {
356
+ code: 'custom',
357
+ path,
358
+ message: issue.message,
359
+ params: issue['params'],
360
+ };
361
+ }
362
+ // ============================================================================
363
+ // ValError Class
364
+ // ============================================================================
365
+ /**
366
+ * Error thrown when `schema.parse()` fails.
367
+ *
368
+ * Contains an array of issues describing all validation failures
369
+ * with Zod-compatible error codes and formatting methods.
370
+ *
371
+ * @example
372
+ * ```typescript
373
+ * try {
374
+ * v.string().parse(123);
375
+ * } catch (error) {
376
+ * if (error instanceof ValError) {
377
+ * console.log(error.issues);
378
+ * // [{ code: 'invalid_type', path: [], message: 'Expected string, received number', ... }]
379
+ *
380
+ * console.log(error.format());
381
+ * // { _errors: ['Expected string, received number'] }
382
+ *
383
+ * console.log(error.flatten());
384
+ * // { formErrors: ['Expected string, received number'], fieldErrors: {} }
385
+ * }
386
+ * }
387
+ * ```
388
+ */
389
+ export class ValError extends Error {
390
+ /** The name of this error class. */
391
+ name = 'ValError';
392
+ /** All validation issues that caused this error. */
393
+ issues;
394
+ /**
395
+ * Creates a new ValError from an array of validation issues.
396
+ */
397
+ constructor(issues) {
398
+ // Cast to the extended type for processing
399
+ const extendedIssues = issues;
400
+ const valIssues = extendedIssues.map(toValIssue);
401
+ const message = ValError.formatMessage(valIssues);
402
+ super(message);
403
+ this.issues = valIssues;
404
+ // Maintain proper prototype chain for instanceof checks
405
+ Object.setPrototypeOf(this, ValError.prototype);
406
+ }
407
+ /**
408
+ * Creates a ValError directly from ValIssue array (no conversion needed).
409
+ */
410
+ static fromValIssues(issues) {
411
+ const error = Object.create(ValError.prototype);
412
+ Object.defineProperty(error, 'issues', { value: issues, writable: false });
413
+ Object.defineProperty(error, 'name', { value: 'ValError', writable: false });
414
+ Object.defineProperty(error, 'message', { value: ValError.formatMessage(issues), writable: false });
415
+ return error;
416
+ }
417
+ /**
418
+ * Formats the validation issues into a human-readable error message.
419
+ */
420
+ static formatMessage(issues) {
421
+ if (issues.length === 0) {
422
+ return 'Validation failed';
423
+ }
424
+ if (issues.length === 1) {
425
+ const issue = issues[0];
426
+ if (issue === undefined) {
427
+ return 'Validation failed';
428
+ }
429
+ const pathStr = issue.path.length > 0 ? ` at ${issue.path.join('.')}` : '';
430
+ return `${issue.message}${pathStr}`;
431
+ }
432
+ const issueMessages = issues.map((issue) => {
433
+ const pathStr = issue.path.length > 0 ? ` at ${issue.path.join('.')}` : '';
434
+ return ` - ${issue.message}${pathStr}`;
435
+ });
436
+ return `Validation failed with ${issues.length} issues:\n${issueMessages.join('\n')}`;
437
+ }
438
+ /**
439
+ * Gets the first validation issue, if any.
440
+ */
441
+ get firstError() {
442
+ return this.issues[0];
443
+ }
444
+ /**
445
+ * Checks if there are errors at the specified path.
446
+ *
447
+ * @param path - Array of path segments to check
448
+ * @returns true if there are errors at the specified path
449
+ *
450
+ * @example
451
+ * ```typescript
452
+ * error.hasErrorAt(['user', 'email']);
453
+ * error.hasErrorAt(['items', 0, 'name']);
454
+ * ```
455
+ */
456
+ hasErrorAt(path) {
457
+ return this.issues.some((issue) => this.pathsMatch(issue.path, path));
458
+ }
459
+ /**
460
+ * Gets all errors at the specified path.
461
+ *
462
+ * @param path - Array of path segments to check
463
+ * @returns Array of issues at the specified path
464
+ *
465
+ * @example
466
+ * ```typescript
467
+ * const emailErrors = error.errorsAt(['user', 'email']);
468
+ * const itemErrors = error.errorsAt(['items', 0]);
469
+ * ```
470
+ */
471
+ errorsAt(path) {
472
+ return this.issues.filter((issue) => this.pathsMatch(issue.path, path));
473
+ }
474
+ /**
475
+ * Checks if two paths match exactly.
476
+ */
477
+ pathsMatch(issuePath, targetPath) {
478
+ if (issuePath.length !== targetPath.length) {
479
+ return false;
480
+ }
481
+ for (let i = 0; i < issuePath.length; i++) {
482
+ if (issuePath[i] !== targetPath[i]) {
483
+ return false;
484
+ }
485
+ }
486
+ return true;
487
+ }
488
+ /**
489
+ * Formats errors as a nested object matching the path structure.
490
+ *
491
+ * Each level has an `_errors` array containing error messages at that level.
492
+ * Nested objects/arrays have their own nested structures.
493
+ *
494
+ * @example
495
+ * ```typescript
496
+ * const error = new ValError([
497
+ * { message: 'Required', path: ['user', 'name'], code: 'custom' },
498
+ * { message: 'Invalid email', path: ['user', 'email'], code: 'custom' },
499
+ * ]);
500
+ *
501
+ * error.format();
502
+ * // {
503
+ * // _errors: [],
504
+ * // user: {
505
+ * // _errors: [],
506
+ * // name: { _errors: ['Required'] },
507
+ * // email: { _errors: ['Invalid email'] },
508
+ * // }
509
+ * // }
510
+ * ```
511
+ */
512
+ format() {
513
+ const result = { _errors: [] };
514
+ for (const issue of this.issues) {
515
+ if (issue.path.length === 0) {
516
+ result._errors.push(issue.message);
517
+ }
518
+ else {
519
+ let current = result;
520
+ for (let i = 0; i < issue.path.length; i++) {
521
+ const segment = issue.path[i];
522
+ const key = String(segment);
523
+ if (i === issue.path.length - 1) {
524
+ // Last segment - add to _errors
525
+ if (current[key] === undefined) {
526
+ current[key] = { _errors: [] };
527
+ }
528
+ const node = current[key];
529
+ if (typeof node === 'object' && '_errors' in node) {
530
+ node._errors.push(issue.message);
531
+ }
532
+ }
533
+ else {
534
+ // Intermediate segment - create nested object if needed
535
+ if (current[key] === undefined) {
536
+ current[key] = { _errors: [] };
537
+ }
538
+ const node = current[key];
539
+ if (typeof node === 'object' && '_errors' in node) {
540
+ current = node;
541
+ }
542
+ }
543
+ }
544
+ }
545
+ }
546
+ return result;
547
+ }
548
+ /**
549
+ * Flattens the issues into a simple object mapping paths to error messages.
550
+ *
551
+ * Form-level errors (no path) go into `formErrors`.
552
+ * Field-level errors go into `fieldErrors` with dot-notation keys.
553
+ *
554
+ * @example
555
+ * ```typescript
556
+ * const error = new ValError([
557
+ * { message: 'Required', path: ['user', 'name'], code: 'custom' },
558
+ * { message: 'Invalid email', path: ['user', 'email'], code: 'custom' },
559
+ * { message: 'Form error', path: [], code: 'custom' },
560
+ * ]);
561
+ *
562
+ * error.flatten();
563
+ * // {
564
+ * // formErrors: ['Form error'],
565
+ * // fieldErrors: {
566
+ * // 'user.name': ['Required'],
567
+ * // 'user.email': ['Invalid email'],
568
+ * // }
569
+ * // }
570
+ * ```
571
+ */
572
+ flatten() {
573
+ const formErrors = [];
574
+ const fieldErrors = {};
575
+ for (const issue of this.issues) {
576
+ if (issue.path.length === 0) {
577
+ formErrors.push(issue.message);
578
+ }
579
+ else {
580
+ const key = issue.path.join('.');
581
+ const existing = fieldErrors[key];
582
+ if (existing !== undefined) {
583
+ existing.push(issue.message);
584
+ }
585
+ else {
586
+ fieldErrors[key] = [issue.message];
587
+ }
588
+ }
589
+ }
590
+ return { formErrors, fieldErrors };
591
+ }
592
+ /**
593
+ * Returns a human-readable string representation of the error.
594
+ */
595
+ toString() {
596
+ return this.message;
597
+ }
598
+ /**
599
+ * Adds a new issue to a copy of this error.
600
+ * Returns a new ValError instance.
601
+ */
602
+ addIssue(issue) {
603
+ return ValError.fromValIssues([...this.issues, issue]);
604
+ }
605
+ /**
606
+ * Adds issues from another ValError to a copy of this error.
607
+ * Returns a new ValError instance.
608
+ */
609
+ addIssues(issues) {
610
+ return ValError.fromValIssues([...this.issues, ...issues]);
611
+ }
612
+ /**
613
+ * Checks if this is a ValError instance.
614
+ */
615
+ static isValError(value) {
616
+ return value instanceof ValError;
617
+ }
618
+ }
619
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmPH,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,IAAI,cAAsC,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgC;IAC1D,cAAc,GAAG,QAAQ,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,cAAc,GAAG,SAAS,CAAC;AAC7B,CAAC;AAED,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAC5C,IAAI,KAAK,CAAC,OAAO,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