@thepeaklab/zod-validators
v1.1.2
Published
Custom zod validator functions
Readme
Zod Validators
Extended zod validator functions for real-world projects.
Installation
$ npm install -S @thepeaklab/zod-validatorsimport { z } from '@thepeaklab/zod-validators';
// Use the extended validators in your schema
const schema = z.object({
name: z.string().min(1),
phone: z.phone(), // <-- custom validator function
});Documentation
This library includes additional zod validator functions from real-world projects for further standardization.
To see all custom validators, have a look at the src/ folder.
This library requires zod as a peer dependency, so you're up to "bring-your-own-zod". We are compatible with zod 3 and 4!
Contributing
Code of Conduct
Please read our Code of conduct to keep our community open and respectable. 💖
Want to help?
Want to report a bug, contribute some code, or improve the documentation? Excellent!
Please abstain from adding npm packages as dependencies to this project unless there is a very good reason to do so (let's discuss this in advance, please).
We intend to keep the overhead of this library as little as possible so that vulnerable third party dependencies don't compromise downstream projects' security.
Please also read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.
Security
If you believe you have found a security vulnerability, we encourage you to responsibly disclose this and not open a public issue. Security issues in this open source project can be safely reported via [email protected].
License
This project is MIT-licensed.
Developed with 💖 at the peak lab.
