Provides typed metadata feature to zod. Library installation
npm install --save-dev @codexsoft/metazod
Put this code into some *.d.ts
file in your project:
import {} from '@codexsoft/metazod';
declare module 'zod' {
interface IMeta {
test: number;
test2: string;
}
}
Now you can write some typed metadata into schema:
const a = z.string().uuid().meta({test: 1, test2: ''})
And read it:
const b = a.getMeta().test;