0.0.4 • Published 9 months ago

@codexsoft/metazod v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

metazod

Provides typed metadata feature to zod. Library installation

npm install --save-dev @codexsoft/metazod 

Usage

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;
0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago