1.0.4 • Published 7 months ago

conf-with-zod v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

conf-with-zod

conf package with zod as json validator

Install

npm install conf-with-zod

Usage

This package works almost identical that original conf, with these diferences:

  • In the property schema you can pass a zod validator like this:
const zodSchema = z.object({
	foo: z.string().optional().default("Bar")
})

const store = new Conf({
	schema: zodSchema
})
  • Normal json-schemas already can passed as schema, but they will pass as conversion with json-schema-to-zod

Know Issues

  • Zod does not have support to unique property in arrays.

Credits

All rigths reserved to sindresorhus, owner of the original conf.