Skip to content

Commit c03a3ad

Browse files
committed
chore(types): improve extended zod types
1 parent 92b8347 commit c03a3ad

File tree

1 file changed

+6
-1
lines changed
  • src/runtime/server/utils

1 file changed

+6
-1
lines changed

src/runtime/server/utils/zod.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { z as zod } from 'zod'
22

3-
export const z = {
3+
interface ExtendedZodMethods {
4+
intAsString: () => zod.ZodEffects<zod.ZodString, number, string>
5+
}
6+
type ExtendedZod = typeof zod & ExtendedZodMethods
7+
8+
export const z: ExtendedZod = {
49
...zod,
510
intAsString: () => zod.string().transform(val => parseInt(val, 10))
611
}

0 commit comments

Comments
 (0)