zod-electron-store
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

zod-electron-store

The same of electron store, but with zod as validador

How to Use

import ZodElectronStore from "zod-electron-store"
import {z} from "zod"

const zodSchema = z.object({
	foo: z.string().default("bar")
})

type DataType = z.infer<typeof zodSchema>

const data = new ZodElectronStore<DataType>({
	//...Other configs
	schema: zodSchema
})

Know issues

Zod does not have support to uniqueItems in arrays.

Credits

All rigths reserved to sindresorhus, owner of the original electron-store.

Package Sidebar

Install

npm i zod-electron-store

Weekly Downloads

28

Version

1.0.5

License

MIT

Unpacked Size

6.03 kB

Total Files

5

Last publish

Collaborators

  • arthur-lobo