Skip to content

codexsoft/metazod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

Provides typed metadata feature to zod

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published