use-zod-default 1.0.23 → 1.0.24
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/v4.js +3 -0
- package/package.json +2 -2
package/dist/v4.js
CHANGED
|
@@ -231,6 +231,9 @@ const defaultInstance = (schema, source) => {
|
|
|
231
231
|
if (schema instanceof z.ZodObject) {
|
|
232
232
|
return processObject(schema, value);
|
|
233
233
|
}
|
|
234
|
+
if (schema instanceof z.ZodOptional) {
|
|
235
|
+
return isNil(value) ? undefined : processValue(schema._zod.def.innerType, value);
|
|
236
|
+
}
|
|
234
237
|
if (schema instanceof z.ZodPipe) {
|
|
235
238
|
if (schema._zod.def.out instanceof z.ZodTransform) {
|
|
236
239
|
return processTransform(schema._zod.def.out, value);
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"typescript": "^5.6.3",
|
|
11
11
|
"typescript-eslint": "^8.32.1",
|
|
12
12
|
"vitest": "^3.2.4",
|
|
13
|
-
"zod": "^4.2.
|
|
13
|
+
"zod": "^4.2.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"lodash": "^4.17.21",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"test:watch": "vitest",
|
|
40
40
|
"test:coverage": "rm -rf coverage && vitest --run --coverage"
|
|
41
41
|
},
|
|
42
|
-
"version": "1.0.
|
|
42
|
+
"version": "1.0.24"
|
|
43
43
|
}
|