1 parent
ac5df6946c
commit
9cc1ef5b31
88 files changed
+88
-87
No files matched your search
@@ -1,14 +0,0 @@
|
||||
import { z } from "zod";
|
||||
const boolean = () => z.preprocess(
|
||||
val => typeof val === 'string' && (val.toLowerCase() === 'false' || val === '0') ? false : Boolean(val),
|
||||
z.boolean()
|
||||
);
|
||||
const number = () => z.preprocess(
|
||||
val => typeof val !== 'number' ? Number(val) : val,
|
||||
z.number()
|
||||
);
|
||||
const string = () => z.preprocess(
|
||||
val => typeof val !== 'string' ? String(val) : val,
|
||||
z.string()
|
||||
);
|
||||
export const actionType = { boolean, number, string };
|
||||
Reference in new issue
Block a user