From 80f9cd11c4a51b7d08b3d5c269a999b28a556a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Wed, 14 Feb 2024 23:55:01 +0100 Subject: [PATCH] feat: add intAsString on zod --- server/utils/zod.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/utils/zod.ts b/server/utils/zod.ts index f2376172..87d5cc7e 100644 --- a/server/utils/zod.ts +++ b/server/utils/zod.ts @@ -1 +1,6 @@ -export { z } from 'zod' +import { z as zod } from 'zod' + +export const z = { + ...zod, + intAsString: () => zod.string().transform(val => parseInt(val, 10)) +}