Remove Zod from core dependencies (#27107)
This commit is contained in:
parent
bc4fdb8370
commit
6b950b666a
4 changed files with 5 additions and 15 deletions
|
|
@ -1,11 +0,0 @@
|
|||
import type { z } from "zod"
|
||||
|
||||
export function fn<T extends z.ZodType, Result>(schema: T, cb: (input: z.infer<T>) => Result) {
|
||||
const result = (input: z.infer<T>) => {
|
||||
const parsed = schema.parse(input)
|
||||
return cb(parsed)
|
||||
}
|
||||
result.force = (input: z.infer<T>) => cb(input)
|
||||
result.schema = schema
|
||||
return result
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue