Zod Utility
Installation
shell
$ npm install @biruni/zod zodshell
$ yarn add @biruni/zod zodshell
$ pnpm add @biruni/zod zodImport
typescript
import { zod } from '@biruni/zod';Import Aliases
typescript
import zod from '@biruni/zod';typescript
import { zod } from '@biruni/zod/mod';typescript
import zod from '@biruni/zod/mod';TIP
The zod also aliased to ZodPlugin named export
Define
typescript
import { z } from 'zod';
const CounterSchema = z.object({
count: z.number().min(1).max(10),
});
type CounterStore = z.infer<typeof CounterSchema>;
export default biruni<CounterStore>(); // optional pass to Generic ParamUsage
typescript
.plug(zod(MyStoreSchema))