Add missing files and fix type aliases for opentui features

This commit is contained in:
Dax Raad
2025-10-06 18:53:35 -04:00
parent 6417edf998
commit cdd6e98af9
5 changed files with 74 additions and 14 deletions

View File

@@ -0,0 +1,11 @@
import { 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
}