Skip to content

Instantly share code, notes, and snippets.

@ryanramage
Created March 19, 2024 14:04
Show Gist options
  • Save ryanramage/b906ce4af4eae6ecd38c070db7670771 to your computer and use it in GitHub Desktop.
Save ryanramage/b906ce4af4eae6ecd38c070db7670771 to your computer and use it in GitHub Desktop.
import z from 'zod'
export const name = 'myFunction'
export const param = z.object({
a: z.string(),
b: z.number()
}).strict
export const returns = z.boolean()
export const MyFunctionSchema = z.function().args(param).returns(returns)
/** @typedef { z.infer<typeof MyFunctionSchema> } MyFunction */
export const dfn = { name, param, returns }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment