{"_id":"is-zod","_rev":"203524","name":"is-zod","description":"Typeguard to check if a value matches a zod schema","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"bconnorwhite","email":""}],"time":{"modified":"2023-03-21T13:24:43.000Z","created":"2023-01-29T20:21:00.103Z","1.0.0":"2023-01-29T20:21:00.103Z"},"users":{},"author":{"name":"Connor White"},"repository":{"type":"git","url":"git+https://github.com/bconnorwhite/is-zod.git"},"versions":{"1.0.0":{"name":"is-zod","version":"1.0.0","description":"Typeguard to check if a value matches a zod schema","license":"MIT","private":false,"author":{"name":"Connor White"},"contributors":[{"name":"Connor White"}],"homepage":"https://connorwhite.dev/github/is-zod","repository":{"type":"git","url":"git+https://github.com/bconnorwhite/is-zod.git"},"bugs":{"url":"https://github.com/bconnorwhite/is-zod/issues"},"keywords":["zod","type","typeguard","schema","is"],"type":"module","main":".auto/build/index.js","exports":"./.auto/build/index.js","types":".auto/build/index.d.ts","engines":{"node":"^14.13.1 || >=16.0.0"},"scripts":{"build":"auto build","dev":"auto dev","lint":"auto lint","prepack":"yarn build","release":"auto release","test":"auto test","typecheck":"auto typecheck"},"dependencies":{"zod":"^3.20.2"},"devDependencies":{"autorepo":"^0.1.9"},"eslintConfig":{"extends":"@autosoft/eslint-config"},"jest":{"preset":"@autosoft/jest-preset"},"npmpackagejsonlint":{"extends":"npm-package-json-lint-config-auto"},"_id":"is-zod@1.0.0","dist":{"shasum":"1afb20384bde67dffdd14c79aedfd4260c90667f","size":1835,"noattachment":false,"key":"/is-zod/-/is-zod-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/is-zod/download/is-zod-1.0.0.tgz"},"_npmUser":{"name":"bconnorwhite","email":"connor.bcw@gmail.com"},"directories":{},"maintainers":[{"name":"bconnorwhite","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-zod_1.0.0_1675023659937_0.28779146573282177"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-29T20:21:00.103Z","publish_time":1675023660103,"_cnpm_publish_time":1675023660103}},"readme":"<!--BEGIN HEADER-->\n<div id=\"top\" align=\"center\">\n  <h1>is-zod</h1>\n  <a href=\"https://npmjs.com/package/is-zod\">\n    <img alt=\"NPM\" src=\"https://img.shields.io/npm/v/is-zod.svg\">\n  </a>\n  <a href=\"https://github.com/bconnorwhite/is-zod\">\n    <img alt=\"TypeScript\" src=\"https://img.shields.io/github/languages/top/bconnorwhite/is-zod.svg\">\n  </a>\n</div>\n\n<br />\n\n<blockquote align=\"center\">Typeguard to check if a value matches a zod schema.</blockquote>\n\n<br />\n\n_If I should maintain this repo, please ⭐️_\n<a href=\"https://github.com/bconnorwhite/is-zod\">\n  <img align=\"right\" alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/bconnorwhite/is-zod?label=%E2%AD%90%EF%B8%8F&style=social\">\n</a>\n\n_DM me on [Twitter](https://twitter.com/bconnorwhite) if you have questions or suggestions._\n<a href=\"https://twitter.com/bconnorwhite\">\n  <img align=\"right\" alt=\"Twitter\" src=\"https://img.shields.io/twitter/url?label=%40bconnorwhite&style=social&url=https%3A%2F%2Ftwitter.com%2Fbconnorwhite\">\n</a>\n\n---\n<!--END HEADER-->\n\n## Installation\n\n```sh\nnpm install is-zod\n```\n\n```sh\nyarn add is-zod\n```\n\n```sh\npnpm add is-zod\n```\n\n## Usage\n\n### Is\n\n```ts\nimport { z } from 'zod';\nimport is from 'is-zod';\n\nconst user = z.object({\n  name: z.string(),\n  age: z.number()\n});\n\nconst value = {\n  name: 'Bob',\n  age: 42\n};\n\nif(is(value, user)) {\n  // value is typed as { name: string; age: number; }\n}\n```\n\n### Validate\n\n```ts\nimport { z } from 'zod';\nimport { validate } from 'is-zod';\n\nconst user = z.object({\n  name: z.string(),\n  age: z.number(),\n});\n\nconst isUser = validate(user);\n\nconst value = {\n  name: 'Bob',\n  age: 42,\n};\n\nif(isUser(value)) {\n  // value is typed as { name: string; age: number; }\n}\n```\n\n<!--BEGIN FOOTER-->\n\n<br />\n\n<h2 id=\"dependencies\">Dependencies<a href=\"https://www.npmjs.com/package/is-zod?activeTab=dependencies\"><img align=\"right\" alt=\"dependencies\" src=\"https://img.shields.io/librariesio/release/npm/is-zod.svg\"></a></h2>\n\n- [zod](https://www.npmjs.com/package/zod): TypeScript-first schema declaration and validation library with static type inference\n\n<br />\n\n<h3>Dev Dependencies</h3>\n\n- [autorepo](https://www.npmjs.com/package/autorepo): Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.\n\n<br />\n\n<h2 id=\"license\">License <a href=\"https://opensource.org/licenses/MIT\"><img align=\"right\" alt=\"license\" src=\"https://img.shields.io/npm/l/is-zod.svg\"></a></h2>\n\n[MIT](https://opensource.org/licenses/MIT)\n<!--END FOOTER-->\n","_attachments":{},"homepage":"https://connorwhite.dev/github/is-zod","bugs":{"url":"https://github.com/bconnorwhite/is-zod/issues"},"license":"MIT"}