@hookform/resolvers 5.4.2 → 5.5.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.
Files changed (125) hide show
  1. package/ajv/dist/ajv.js.map +1 -1
  2. package/ajv/dist/ajv.modern.mjs.map +1 -1
  3. package/ajv/dist/ajv.module.js.map +1 -1
  4. package/ajv/dist/ajv.umd.js.map +1 -1
  5. package/arktype/dist/arktype.js.map +1 -1
  6. package/arktype/dist/arktype.modern.mjs.map +1 -1
  7. package/arktype/dist/arktype.module.js.map +1 -1
  8. package/arktype/dist/arktype.umd.js.map +1 -1
  9. package/arktype/src/__tests__/__snapshots__/arktype.ts.snap +11 -11
  10. package/arktype/src/__tests__/arktype.ts +15 -6
  11. package/ata-validator/dist/ata-validator.js.map +1 -1
  12. package/ata-validator/dist/ata-validator.modern.mjs.map +1 -1
  13. package/ata-validator/dist/ata-validator.module.js.map +1 -1
  14. package/ata-validator/dist/ata-validator.umd.js.map +1 -1
  15. package/class-validator/dist/class-validator.js.map +1 -1
  16. package/class-validator/dist/class-validator.modern.mjs.map +1 -1
  17. package/class-validator/dist/class-validator.module.js.map +1 -1
  18. package/class-validator/dist/class-validator.umd.js.map +1 -1
  19. package/computed-types/dist/computed-types.js.map +1 -1
  20. package/computed-types/dist/computed-types.modern.mjs.map +1 -1
  21. package/computed-types/dist/computed-types.module.js.map +1 -1
  22. package/computed-types/dist/computed-types.umd.js.map +1 -1
  23. package/computed-types/src/__tests__/computed-types.ts +15 -6
  24. package/dist/resolvers.js.map +1 -1
  25. package/dist/resolvers.mjs.map +1 -1
  26. package/dist/resolvers.module.js.map +1 -1
  27. package/dist/resolvers.umd.js.map +1 -1
  28. package/effect-ts/dist/effect-ts.js.map +1 -1
  29. package/effect-ts/dist/effect-ts.modern.mjs.map +1 -1
  30. package/effect-ts/dist/effect-ts.module.js.map +1 -1
  31. package/effect-ts/dist/effect-ts.umd.js.map +1 -1
  32. package/effect-ts/src/__tests__/effect-ts.ts +15 -6
  33. package/fluentvalidation-ts/dist/fluentvalidation-ts.js.map +1 -1
  34. package/fluentvalidation-ts/dist/fluentvalidation-ts.modern.mjs.map +1 -1
  35. package/fluentvalidation-ts/dist/fluentvalidation-ts.module.js.map +1 -1
  36. package/fluentvalidation-ts/dist/fluentvalidation-ts.umd.js.map +1 -1
  37. package/io-ts/dist/io-ts.js.map +1 -1
  38. package/io-ts/dist/io-ts.modern.mjs.map +1 -1
  39. package/io-ts/dist/io-ts.module.js.map +1 -1
  40. package/io-ts/dist/io-ts.umd.js.map +1 -1
  41. package/io-ts/src/__tests__/io-ts.ts +15 -6
  42. package/joi/dist/joi.js.map +1 -1
  43. package/joi/dist/joi.modern.mjs.map +1 -1
  44. package/joi/dist/joi.module.js.map +1 -1
  45. package/joi/dist/joi.umd.js.map +1 -1
  46. package/nope/dist/nope.js.map +1 -1
  47. package/nope/dist/nope.modern.mjs.map +1 -1
  48. package/nope/dist/nope.module.js.map +1 -1
  49. package/nope/dist/nope.umd.js.map +1 -1
  50. package/nope/dist/types.d.ts +2 -1
  51. package/nope/src/nope.ts +7 -1
  52. package/nope/src/types.ts +7 -1
  53. package/package.json +31 -28
  54. package/standard-schema/dist/standard-schema.js.map +1 -1
  55. package/standard-schema/dist/standard-schema.modern.mjs.map +1 -1
  56. package/standard-schema/dist/standard-schema.module.js.map +1 -1
  57. package/standard-schema/dist/standard-schema.umd.js.map +1 -1
  58. package/standard-schema/src/__tests__/__snapshots__/standard-schema.ts.snap +31 -0
  59. package/standard-schema/src/__tests__/standard-schema.ts +21 -13
  60. package/superstruct/dist/superstruct.d.ts +5 -0
  61. package/superstruct/dist/superstruct.js.map +1 -1
  62. package/superstruct/dist/superstruct.modern.mjs.map +1 -1
  63. package/superstruct/dist/superstruct.module.js.map +1 -1
  64. package/superstruct/dist/superstruct.umd.js.map +1 -1
  65. package/superstruct/src/__tests__/superstruct.ts +22 -8
  66. package/superstruct/src/superstruct.ts +13 -0
  67. package/typanion/dist/typanion.js.map +1 -1
  68. package/typanion/dist/typanion.modern.mjs.map +1 -1
  69. package/typanion/dist/typanion.module.js.map +1 -1
  70. package/typanion/dist/typanion.umd.js.map +1 -1
  71. package/typanion/src/__tests__/typanion.ts +8 -3
  72. package/typebox/dist/typebox.js.map +1 -1
  73. package/typebox/dist/typebox.modern.mjs.map +1 -1
  74. package/typebox/dist/typebox.module.js.map +1 -1
  75. package/typebox/dist/typebox.umd.js.map +1 -1
  76. package/typebox/src/__tests__/typebox.ts +31 -18
  77. package/typeschema/dist/typeschema.js +1 -1
  78. package/typeschema/dist/typeschema.js.map +1 -1
  79. package/typeschema/dist/typeschema.mjs +1 -1
  80. package/typeschema/dist/typeschema.modern.mjs +1 -1
  81. package/typeschema/dist/typeschema.modern.mjs.map +1 -1
  82. package/typeschema/dist/typeschema.module.js +1 -1
  83. package/typeschema/dist/typeschema.module.js.map +1 -1
  84. package/typeschema/dist/typeschema.umd.js +1 -1
  85. package/typeschema/dist/typeschema.umd.js.map +1 -1
  86. package/typeschema/src/__tests__/Form-native-validation.tsx +1 -2
  87. package/typeschema/src/__tests__/Form.tsx +1 -2
  88. package/typeschema/src/__tests__/typeschema.ts +23 -15
  89. package/typeschema/src/typeschema.ts +6 -6
  90. package/valibot/dist/valibot.js.map +1 -1
  91. package/valibot/dist/valibot.modern.mjs.map +1 -1
  92. package/valibot/dist/valibot.module.js.map +1 -1
  93. package/valibot/dist/valibot.umd.js.map +1 -1
  94. package/valibot/src/__tests__/valibot.ts +15 -6
  95. package/vest/dist/vest.js.map +1 -1
  96. package/vest/dist/vest.modern.mjs.map +1 -1
  97. package/vest/dist/vest.module.js.map +1 -1
  98. package/vest/dist/vest.umd.js.map +1 -1
  99. package/vine/dist/vine.js.map +1 -1
  100. package/vine/dist/vine.modern.mjs.map +1 -1
  101. package/vine/dist/vine.module.js.map +1 -1
  102. package/vine/dist/vine.umd.js.map +1 -1
  103. package/vine/src/__tests__/vine.ts +15 -6
  104. package/yup/dist/yup.js.map +1 -1
  105. package/yup/dist/yup.modern.mjs.map +1 -1
  106. package/yup/dist/yup.module.js.map +1 -1
  107. package/yup/dist/yup.umd.js.map +1 -1
  108. package/yup/src/__tests__/yup.ts +15 -6
  109. package/yup/src/yup.ts +10 -2
  110. package/zod/dist/zod.js +1 -1
  111. package/zod/dist/zod.js.map +1 -1
  112. package/zod/dist/zod.mjs +1 -1
  113. package/zod/dist/zod.modern.mjs +1 -1
  114. package/zod/dist/zod.modern.mjs.map +1 -1
  115. package/zod/dist/zod.module.js +1 -1
  116. package/zod/dist/zod.module.js.map +1 -1
  117. package/zod/dist/zod.umd.js +1 -1
  118. package/zod/dist/zod.umd.js.map +1 -1
  119. package/zod/src/__tests__/__snapshots__/zod-v3.ts.snap +430 -0
  120. package/zod/src/__tests__/__snapshots__/zod-v4-mini.ts.snap +472 -0
  121. package/zod/src/__tests__/__snapshots__/zod-v4.ts.snap +434 -0
  122. package/zod/src/__tests__/zod-v3.ts +45 -6
  123. package/zod/src/__tests__/zod-v4-mini.ts +21 -11
  124. package/zod/src/__tests__/zod-v4.ts +47 -11
  125. package/zod/src/zod.ts +15 -2
@@ -0,0 +1,430 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`zodResolver > should return a single error from zodResolver when validation fails 1`] = `
4
+ {
5
+ "errors": {
6
+ "accessToken": {
7
+ "message": "Required",
8
+ "ref": undefined,
9
+ "type": "invalid_type",
10
+ },
11
+ "birthYear": {
12
+ "message": "Expected number, received string",
13
+ "ref": undefined,
14
+ "type": "invalid_type",
15
+ },
16
+ "dateStr": {
17
+ "message": "Required",
18
+ "ref": undefined,
19
+ "type": "invalid_type",
20
+ },
21
+ "email": {
22
+ "message": "Invalid email",
23
+ "ref": {
24
+ "name": "email",
25
+ },
26
+ "type": "invalid_string",
27
+ },
28
+ "enabled": {
29
+ "message": "Required",
30
+ "ref": undefined,
31
+ "type": "invalid_type",
32
+ },
33
+ "like": [
34
+ {
35
+ "id": {
36
+ "message": "Expected number, received string",
37
+ "ref": undefined,
38
+ "type": "invalid_type",
39
+ },
40
+ "name": {
41
+ "message": "Required",
42
+ "ref": undefined,
43
+ "type": "invalid_type",
44
+ },
45
+ },
46
+ ],
47
+ "password": {
48
+ "message": "One uppercase character",
49
+ "ref": {
50
+ "name": "password",
51
+ },
52
+ "type": "invalid_string",
53
+ },
54
+ "repeatPassword": {
55
+ "message": "Required",
56
+ "ref": undefined,
57
+ "type": "invalid_type",
58
+ },
59
+ "tags": {
60
+ "message": "Required",
61
+ "ref": undefined,
62
+ "type": "invalid_type",
63
+ },
64
+ "url": {
65
+ "message": "Custom error url",
66
+ "ref": undefined,
67
+ "type": "invalid_string",
68
+ },
69
+ "username": {
70
+ "message": "Required",
71
+ "ref": {
72
+ "name": "username",
73
+ },
74
+ "type": "invalid_type",
75
+ },
76
+ },
77
+ "values": {},
78
+ }
79
+ `;
80
+
81
+ exports[`zodResolver > should return a single error from zodResolver with \`mode: sync\` when validation fails 1`] = `
82
+ {
83
+ "errors": {
84
+ "accessToken": {
85
+ "message": "Required",
86
+ "ref": undefined,
87
+ "type": "invalid_type",
88
+ },
89
+ "birthYear": {
90
+ "message": "Expected number, received string",
91
+ "ref": undefined,
92
+ "type": "invalid_type",
93
+ },
94
+ "dateStr": {
95
+ "message": "Required",
96
+ "ref": undefined,
97
+ "type": "invalid_type",
98
+ },
99
+ "email": {
100
+ "message": "Invalid email",
101
+ "ref": {
102
+ "name": "email",
103
+ },
104
+ "type": "invalid_string",
105
+ },
106
+ "enabled": {
107
+ "message": "Required",
108
+ "ref": undefined,
109
+ "type": "invalid_type",
110
+ },
111
+ "like": [
112
+ {
113
+ "id": {
114
+ "message": "Expected number, received string",
115
+ "ref": undefined,
116
+ "type": "invalid_type",
117
+ },
118
+ "name": {
119
+ "message": "Required",
120
+ "ref": undefined,
121
+ "type": "invalid_type",
122
+ },
123
+ },
124
+ ],
125
+ "password": {
126
+ "message": "One uppercase character",
127
+ "ref": {
128
+ "name": "password",
129
+ },
130
+ "type": "invalid_string",
131
+ },
132
+ "repeatPassword": {
133
+ "message": "Required",
134
+ "ref": undefined,
135
+ "type": "invalid_type",
136
+ },
137
+ "tags": {
138
+ "message": "Required",
139
+ "ref": undefined,
140
+ "type": "invalid_type",
141
+ },
142
+ "url": {
143
+ "message": "Custom error url",
144
+ "ref": undefined,
145
+ "type": "invalid_string",
146
+ },
147
+ "username": {
148
+ "message": "Required",
149
+ "ref": {
150
+ "name": "username",
151
+ },
152
+ "type": "invalid_type",
153
+ },
154
+ },
155
+ "values": {},
156
+ }
157
+ `;
158
+
159
+ exports[`zodResolver > should return all the errors from zodResolver when validation fails with \`validateAllFieldCriteria\` set to true 1`] = `
160
+ {
161
+ "errors": {
162
+ "accessToken": {
163
+ "message": "Required",
164
+ "ref": undefined,
165
+ "type": "invalid_type",
166
+ "types": {
167
+ "invalid_type": [
168
+ "Required",
169
+ "Required",
170
+ ],
171
+ "invalid_union": "Invalid input",
172
+ },
173
+ },
174
+ "birthYear": {
175
+ "message": "Expected number, received string",
176
+ "ref": undefined,
177
+ "type": "invalid_type",
178
+ "types": {
179
+ "invalid_type": "Expected number, received string",
180
+ },
181
+ },
182
+ "dateStr": {
183
+ "message": "Required",
184
+ "ref": undefined,
185
+ "type": "invalid_type",
186
+ "types": {
187
+ "invalid_type": "Required",
188
+ },
189
+ },
190
+ "email": {
191
+ "message": "Invalid email",
192
+ "ref": {
193
+ "name": "email",
194
+ },
195
+ "type": "invalid_string",
196
+ "types": {
197
+ "invalid_string": "Invalid email",
198
+ },
199
+ },
200
+ "enabled": {
201
+ "message": "Required",
202
+ "ref": undefined,
203
+ "type": "invalid_type",
204
+ "types": {
205
+ "invalid_type": "Required",
206
+ },
207
+ },
208
+ "like": [
209
+ {
210
+ "id": {
211
+ "message": "Expected number, received string",
212
+ "ref": undefined,
213
+ "type": "invalid_type",
214
+ "types": {
215
+ "invalid_type": "Expected number, received string",
216
+ },
217
+ },
218
+ "name": {
219
+ "message": "Required",
220
+ "ref": undefined,
221
+ "type": "invalid_type",
222
+ "types": {
223
+ "invalid_type": "Required",
224
+ },
225
+ },
226
+ },
227
+ ],
228
+ "password": {
229
+ "message": "One uppercase character",
230
+ "ref": {
231
+ "name": "password",
232
+ },
233
+ "type": "invalid_string",
234
+ "types": {
235
+ "invalid_string": [
236
+ "One uppercase character",
237
+ "One lowercase character",
238
+ "One number",
239
+ ],
240
+ "too_small": "Must be at least 8 characters in length",
241
+ },
242
+ },
243
+ "repeatPassword": {
244
+ "message": "Required",
245
+ "ref": undefined,
246
+ "type": "invalid_type",
247
+ "types": {
248
+ "invalid_type": "Required",
249
+ },
250
+ },
251
+ "tags": {
252
+ "message": "Required",
253
+ "ref": undefined,
254
+ "type": "invalid_type",
255
+ "types": {
256
+ "invalid_type": "Required",
257
+ },
258
+ },
259
+ "url": {
260
+ "message": "Custom error url",
261
+ "ref": undefined,
262
+ "type": "invalid_string",
263
+ "types": {
264
+ "invalid_string": "Custom error url",
265
+ },
266
+ },
267
+ "username": {
268
+ "message": "Required",
269
+ "ref": {
270
+ "name": "username",
271
+ },
272
+ "type": "invalid_type",
273
+ "types": {
274
+ "invalid_type": "Required",
275
+ },
276
+ },
277
+ },
278
+ "values": {},
279
+ }
280
+ `;
281
+
282
+ exports[`zodResolver > should return all the errors from zodResolver when validation fails with \`validateAllFieldCriteria\` set to true and \`mode: sync\` 1`] = `
283
+ {
284
+ "errors": {
285
+ "accessToken": {
286
+ "message": "Required",
287
+ "ref": undefined,
288
+ "type": "invalid_type",
289
+ "types": {
290
+ "invalid_type": [
291
+ "Required",
292
+ "Required",
293
+ ],
294
+ "invalid_union": "Invalid input",
295
+ },
296
+ },
297
+ "birthYear": {
298
+ "message": "Expected number, received string",
299
+ "ref": undefined,
300
+ "type": "invalid_type",
301
+ "types": {
302
+ "invalid_type": "Expected number, received string",
303
+ },
304
+ },
305
+ "dateStr": {
306
+ "message": "Required",
307
+ "ref": undefined,
308
+ "type": "invalid_type",
309
+ "types": {
310
+ "invalid_type": "Required",
311
+ },
312
+ },
313
+ "email": {
314
+ "message": "Invalid email",
315
+ "ref": {
316
+ "name": "email",
317
+ },
318
+ "type": "invalid_string",
319
+ "types": {
320
+ "invalid_string": "Invalid email",
321
+ },
322
+ },
323
+ "enabled": {
324
+ "message": "Required",
325
+ "ref": undefined,
326
+ "type": "invalid_type",
327
+ "types": {
328
+ "invalid_type": "Required",
329
+ },
330
+ },
331
+ "like": [
332
+ {
333
+ "id": {
334
+ "message": "Expected number, received string",
335
+ "ref": undefined,
336
+ "type": "invalid_type",
337
+ "types": {
338
+ "invalid_type": "Expected number, received string",
339
+ },
340
+ },
341
+ "name": {
342
+ "message": "Required",
343
+ "ref": undefined,
344
+ "type": "invalid_type",
345
+ "types": {
346
+ "invalid_type": "Required",
347
+ },
348
+ },
349
+ },
350
+ ],
351
+ "password": {
352
+ "message": "One uppercase character",
353
+ "ref": {
354
+ "name": "password",
355
+ },
356
+ "type": "invalid_string",
357
+ "types": {
358
+ "invalid_string": [
359
+ "One uppercase character",
360
+ "One lowercase character",
361
+ "One number",
362
+ ],
363
+ "too_small": "Must be at least 8 characters in length",
364
+ },
365
+ },
366
+ "repeatPassword": {
367
+ "message": "Required",
368
+ "ref": undefined,
369
+ "type": "invalid_type",
370
+ "types": {
371
+ "invalid_type": "Required",
372
+ },
373
+ },
374
+ "tags": {
375
+ "message": "Required",
376
+ "ref": undefined,
377
+ "type": "invalid_type",
378
+ "types": {
379
+ "invalid_type": "Required",
380
+ },
381
+ },
382
+ "url": {
383
+ "message": "Custom error url",
384
+ "ref": undefined,
385
+ "type": "invalid_string",
386
+ "types": {
387
+ "invalid_string": "Custom error url",
388
+ },
389
+ },
390
+ "username": {
391
+ "message": "Required",
392
+ "ref": {
393
+ "name": "username",
394
+ },
395
+ "type": "invalid_type",
396
+ "types": {
397
+ "invalid_type": "Required",
398
+ },
399
+ },
400
+ },
401
+ "values": {},
402
+ }
403
+ `;
404
+
405
+ exports[`zodResolver > should return parsed values from zodResolver with \`mode: sync\` when validation pass 1`] = `
406
+ {
407
+ "errors": {},
408
+ "values": {
409
+ "accessToken": "accessToken",
410
+ "birthYear": 2000,
411
+ "dateStr": 2020-01-01T00:00:00.000Z,
412
+ "email": "john@doe.com",
413
+ "enabled": true,
414
+ "like": [
415
+ {
416
+ "id": 1,
417
+ "name": "name",
418
+ },
419
+ ],
420
+ "password": "Password123_",
421
+ "repeatPassword": "Password123_",
422
+ "tags": [
423
+ "tag1",
424
+ "tag2",
425
+ ],
426
+ "url": "https://react-hook-form.com/",
427
+ "username": "Doe",
428
+ },
429
+ }
430
+ `;