We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92b8347 commit c03a3adCopy full SHA for c03a3ad
src/runtime/server/utils/zod.ts
@@ -1,6 +1,11 @@
1
import { z as zod } from 'zod'
2
3
-export const z = {
+interface ExtendedZodMethods {
4
+ intAsString: () => zod.ZodEffects<zod.ZodString, number, string>
5
+}
6
+type ExtendedZod = typeof zod & ExtendedZodMethods
7
+
8
+export const z: ExtendedZod = {
9
...zod,
10
intAsString: () => zod.string().transform(val => parseInt(val, 10))
11
}
0 commit comments