MCPcopy Create free account
hub / github.com/arctic-cli/interface / result

Function result

packages/util/src/fn.ts:4–7  ·  view source on GitHub ↗
(input: z.infer<T>)

Source from the content-addressed store, hash-verified

2
3export function fn<T extends z.ZodType, Result>(schema: T, cb: (input: z.infer<T>) => Result) {
4 const result = (input: z.infer<T>) => {
5 const parsed = schema.parse(input)
6 return cb(parsed)
7 }
8 result.force = (input: z.infer<T>) => cb(input)
9 result.schema = schema
10 return result

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected