{"name":"zod","version":"1.10.2-canary","description":"TypeScript-first schema declaration and validation library with static type inference","main":"./lib/src/index.js","types":"./lib/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/vriad/zod.git"},"author":{"name":"Colin McDonnell","email":"colin@vriad.com"},"license":"MIT","sideEffects":false,"bugs":{"url":"https://github.com/vriad/zod/issues"},"homepage":"https://github.com/vriad/zod","dependencies":{},"tags":["typescript","schema","validation","type","inference"],"keywords":["typescript","schema","validation","type","inference"],"scripts":{"clean":"rm -rf lib/*","build":"yarn run clean && tsc --p tsconfig.package.json","format":"prettier --write \"src/**/*.ts\" \"src/**/*.js\"","lint":"tslint -p tsconfig.json","test":"jest --config jestconfig.json --coverage && yarn run badge","testone":"jest --config jestconfig.json ","badge":"make-coverage-badge --output-path ./coverage.svg","prepublishOnly":"npm run build","play":"nodemon -e ts -w . -x ts-node src/playground.ts"},"devDependencies":{"@types/jest":"^25.1.4","jest":"^25.1.0","make-coverage-badge":"^1.2.0","nodemon":"^2.0.2","prettier":"^1.19.1","ts-jest":"^25.2.1","tslint":"^6.1.0","tslint-config-prettier":"^1.18.0","typescript":"3.3"},"gitHead":"8597d3c279f42dd37602dee6548770ac5a95cd68","readme":"<p align=\"center\">\n  <img src=\"logo.svg\" width=\"200px\" align=\"center\" />\n  <h1 align=\"center\">Zod</h1>\n</p>\n<p align=\"center\">\n  <a href=\"https://opensource.org/licenses/MIT\" rel=\"nofollow\"><img src=\"https://img.shields.io/github/license/vriad/zod\" alt=\"License\"></a>\n  <a href=\"https://www.npmjs.com/package/zod\" rel=\"nofollow\"><img src=\"https://img.shields.io/npm/dw/zod.svg\" alt=\"npm\"></a>\n  <a href=\"https://www.npmjs.com/package/zod\" rel=\"nofollow\"><img src=\"https://img.shields.io/github/stars/vriad/zod\" alt=\"stars\"></a>\n  <a href=\"./src/__tests__\" rel=\"nofollow\"><img src=\"./coverage.svg\" alt=\"coverage\"></a>\n</p>\n<p align=\"center\">\nif you're happy and you know it, star this repo ⭐\n</p>\n\n<br/>\n\n<!-- Created and maintained by [@vriad](https://twitter.com/vriad). The motivation for this library and a detailed comparison to various alternatives can be found at https://vriad.com/blog/zod.\n\nIf you find this package useful, leave a star to help more folks find it ⭐️🤏 -->\n\n<!-- <br/> -->\n\n# What is Zod\n\nZod is a TypeScript-first schema declaration and validation library. I'm using the term \"schema\" to broadly refer to any data type/structure, from a simple `string` to a complex nested object.\n\nZod is designed to be as developer-friendly as possible. My goal is to eliminate duplicative type declarations wherever possible. With Zod, you declare a validator _once_ and Zod will automatically infer the static TypeScript type. It's easy to compose simpler types into complex data structures.\n\nSome other great aspects:\n\n- Zero dependencies\n- Tiny: 8kb minified + zipped\n- Immutability: methods (i.e. `.optional()` return a new instance\n- Concise, chainable interface\n- Functional approach: [parse, don't validate](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/)\n\n# Sponsorship\n\nHi! 👋 I'm Colin (AKA [@vriad](https://twitter.com/vriad)), creator/maintainer of Zod. Currently I work on Zod in my spare time, but I'd love to drop my other commitments and work on it (and other OSS projects) full time. To that end, I recently applied and was accepted into the GitHub Sponsors program, which I hope will provide the resources I need to focus on open-source full time.\n\nIf you make money from the software you build with Zod, I would massively appreciate a sponsorship at any level! 🙏\n\nColin\nhttps://github.com/sponsors/vriad\n\n### Sponsors\n\n<table>\n  <tr>\n  <td align=\"center\">\n      <a href=\"https://github.com/kevinsimper\">\n        <img src=\"https://avatars1.githubusercontent.com/u/1126497?s=460&v=4\" width=\"100px;\" alt=\"\" />\n      </a>\n      <br>\n      <b>Kevin Simper</b>\n      <br>\n      <a href=\"https://github.com/kevinsimper\">@kevinsimper</a>\n    </td>\n    <td align=\"center\">\n      <a href=\"https://twitter.com/flybayer\">\n        <img src=\"https://avatars2.githubusercontent.com/u/8813276?s=460&u=4ff8beb9a67b173015c4b426a92d89cab960af1b&v=4\" width=\"100px;\" alt=\"\"/>\n      </a>\n      <br>\n      <b>Brandon Bayer</b>\n      <br/>\n      <a href=\"https://twitter.com/flybayer\">@flybayer</a>,\n      <span>creator of <a href=\"https://blitzjs.com\">Blitz.js</a></span>\n      <br />\n    </td>\n  </tr>\n</table>\n\n_To get your name + Twitter + website here, sponsor Zod at the [Freelancer](https://github.com/sponsors/vriad) or [Consultancy](https://github.com/sponsors/vriad) tier._\n\n# Table of contents\n\n- [Installation](#installation)\n  <!-- - [Usage](#usage) -->\n- [Primitives](#primitives)\n- [Literals](#literals)\n- [Parsing](#parsing)\n- [Type inference](#type-inference)\n- [Custom validation](#custom-validation)\n- [Strings](#strings)\n- [Numbers](#numbers)\n- [Objects](#objects)\n  - [.shape](#shape-property)\n  - [.merge](#merging)\n  - [.extend](#extending-objects)\n  - [.pick/.omit](#masking)\n  - [.partial/.deepPartial](#partials)\n  - [.nonstrict](#unknown-keys)\n- [Records](#records)\n- [Arrays](#arrays)\n  - [.nonempty](#non-empty-lists)\n- [Unions](#unions)\n  - [.optional](#optional-types)\n  - [.nullable](#nullable-types)\n  - [.enum](#enums)\n- [Intersections](#intersections)\n- [Tuples](#tuples)\n- [Recursive types](#recursive-types)\n  - [JSON type](#json-type)\n  - [Cyclical data](#cyclical-objects)\n- [Promises](#promises)\n- [Instanceof](#instanceof)\n- [Function schemas](#function-schemas)\n- [Errors](#errors)\n- [Comparison](#comparison)\n  - [Joi](#joi)\n  - [Yup](#yup)\n  - [io-ts](#io-ts)\n  - [Runtypes](#runtypes)\n- [Changelog](#changelog)\n\n# Installation\n\nTo install the latest version:\n\n```sh\nnpm install --save zod\n```\n\n```sh\nyarn add zod\n```\n\n#### TypeScript requirements\n\n1. Zod 1.x requires TypeScript 3.3+\n   > Support for TS 3.2 was dropped with the release of zod@1.10 on 19 July 2020\n2. You must enable `strictNullChecks` or use `strict` mode which includes `strictNullChecks`. Otherwise Zod can't correctly infer the types of your schemas!\n   ```ts\n   // tsconfig.json\n   {\n     \"compilerOptions\": {\n       // ...\n       \"strictNullChecks\": true\n     }\n   }\n   ```\n\n# Usage\n\nZod is a validation library designed for optimal developer experience. It's a TypeScript-first schema declaration library with rigorous inferred types, incredible developer experience, and a few killer features missing from the existing libraries.\n\n<!-- - It infers the statically types of your schemas\n- Eliminates the need to keep static types and runtime validators in sync by hand\n- It has a composable, declarative API that makes it easy to define complex types concisely.\n- Schemas are immutable. All methods return a new schema instance. -->\n\n<!-- Zod was also designed with some core principles designed to make all declarations as non-magical and developer-friendly as possible: -->\n\n- Zero dependencies (5kb compressed)\n- Immutability; methods (i.e. `.optional()` return a new instance\n- Concise, chainable interface\n- Functional approach ([\"Parse, don't validate!\"](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/))\n\n## Primitives\n\nYou can create a Zod schema for any TypeScript primitive.\n\n```ts\nimport * as z from 'zod';\n\n// primitive values\nz.string();\nz.number();\nz.bigint();\nz.boolean();\nz.date();\n\n// empty types\nz.undefined();\nz.null();\nz.void();\n\n// catch-all types\nz.any();\nz.unknown();\n```\n\n## Literals\n\n```ts\nconst tuna = z.literal('tuna');\nconst twelve = z.literal(12);\nconst tru = z.literal(true);\n```\n\n> Currently there is no support for Date or bigint literals in Zod. If you have a use case for this feature, please file an issue.\n\n## Validation\n\n### Parsing\n\n`.parse(data:unknown)`\n\nGiven any Zod schema, you can call its `.parse` method to check `data` is valid. If it is, a value is returned with full type information! Otherwise, an error is thrown.\n\n> IMPORTANT: As of Zod 1.4, the value returned by `.parse` is _the same variable you passed in_. Previously it returned a deep clone. The only exception to this is `Promise` schemas, which return a new Promise for reasons explained in the documentation.\n\n```ts\nconst stringSchema = z.string();\nstringSchema.parse('fish'); // => returns \"fish\"\nstringSchema.parse(12); // throws Error('Non-string type: number');\n```\n\n### Type guards\n\n`.check(data:unknown)`\n\nYou can also use a Zod schema as a type guard using the schema's `.check()` method, like so:\n\n```ts\nconst stringSchema = z.string();\nconst blob: any = 'Albuquerque';\nif (stringSchema.check(blob)) {\n  // blob is now of type `string`\n  // within this if statement\n}\n```\n\nYou can use the same method to check for invalid data:\n\n```ts\nconst stringSchema = z.string();\n\nconst process = (blob: any) => {\n  if (!stringSchema.check(blob)) {\n    throw new Error('Not a string');\n  }\n\n  // blob is now of type `string`\n  // underneath the if statement\n};\n```\n\n### Custom validation\n\n`.refine(validator: (data:T)=>any, params?: RefineParams)`\n\nZod was designed to mirror TypeScript as closely as possible. But there are many so-called \"refinement types\" you may wish to check for that can't be represented in TypeScript's type system. For instance: checking that a number is an Int or that a string is a valid email address.\n\nFor this instances, you can define custom a validation check on _any_ Zod schema with `.refine`:\n\n```ts\nconst myString = z.string().refine(val => val.length <= 255, {\n  message: \"String can't be more than 255 characters\",\n});\n```\n\nAs you can see, `.refine` takes two arguments.\n\n1. The first is the validation function. This function takes one input (of type `T` — the inferred type of the schema) and returns `any`. Any truthy value will pass validation. (Prior to zod@1.6.2 the validation function had to return a boolean.)\n2. The second argument is a params object. You can use this to customize certain error-handling behavior:\n\n   ```ts\n   type RefineParams = {\n     // override error message\n     message?: string;\n\n     // appended to error path\n     path?: (string | number)[];\n\n     // params object you can use to customize message\n     // in error map\n     params?: object;\n   };\n   ```\n\nThese params let you define powerful custom behavior. Zod is commonly used for form validation. If you want to verify that \"password\" and \"confirm\" match, you can do so like this:\n\n```ts\nz.object({\n  password: z.string(),\n  confirm: z.string(),\n})\n  .refine(data => data.password === data.confirm, {\n    message: \"Passwords don't match\",\n    path: ['confirm'], // set path of error\n  })\n  .parse({ password: 'asdf', confirm: 'qwer' });\n```\n\nBecause you provided a `path` parameter, the resulting error will be:\n\n```ts\nZodError {\n  errors: [{\n    \"code\": \"custom_error\",\n    \"path\": [ \"confirm\" ],\n    \"message\": \"Invalid input.\"\n  }]\n}\n```\n\nNote that the `path` is set to `[\"confirm\"]`, so you can easily display this error underneath the \"Confirm password\" textbox.\n\n## Type inference\n\nYou can extract the TypeScript type of any schema with `z.infer<typeof mySchema>`.\n\n```ts\nconst A = z.string();\ntype A = z.infer<typeof A>; // string\n\nconst u: A = 12; // TypeError\nconst u: A = 'asdf'; // compiles\n```\n\nWe'll include examples of inferred types throughout the rest of the documentation.\n\n## Strings\n\nThere are a handful of string-specific validations.\n\nAll of these validations allow you to _optionally_ specify a custom error message.\n\n```ts\nz.string().min(5);\nz.string().max(5);\nz.string().length(5);\nz.string().email();\nz.string().url();\nz.string().uuid();\n```\n\n> Check out [validator.js](https://github.com/validatorjs/validator.js) for a bunch of other useful string validation functions.\n\n### Custom error messages\n\nLike `.refine`, The final (optional) argument is an object that lets you provide a custom error in the `message` field.\n\n```ts\nz.string().min(5, { message: 'Must be 5 or more characters long' });\nz.string().max(5, { message: 'Must be 5 or fewer characters long' });\nz.string().length(5, { message: 'Must be exactly 5 characters long' });\nz.string().email({ message: 'Invalid email address.' });\nz.string().url({ message: 'Invalid url' });\nz.string().uuid({ message: 'Invalid UUID' });\n```\n\n> To see the email and url regexes, check out [this file](https://github.com/vriad/zod/blob/master/src/types/string.ts). To use a more advanced method, use a custom refinement.\n\n## Numbers\n\nThere are a handful of number-specific validations.\n\n```ts\nz.number().min(5);\nz.number().max(5);\n\nz.number().int(); // value must be an integer\n\nz.number().positive(); //     > 0\nz.number().nonnegative(); //  >= 0\nz.number().negative(); //     < 0\nz.number().nonpositive(); //  <= 0\n```\n\nYou can optionally pass in a params object as the second argument to provide a custom error message.\n\n```ts\nz.number().max(5, { message: 'this👏is👏too👏big' });\n```\n\n## Objects\n\n```ts\n// all properties are required by default\nconst dogSchema = z.object({\n  name: z.string(),\n  neutered: z.boolean(),\n});\n\ntype Dog = z.infer<typeof dogSchema>;\n/* \nequivalent to:\ntype Dog = { \n  name:string; \n  neutered: boolean;\n}\n*/\n\nconst cujo = dogSchema.parse({\n  name: 'Cujo',\n  neutered: true,\n}); // passes, returns Dog\n\nconst fido: Dog = {\n  name: 'Fido',\n}; // TypeError: missing required property `neutered`\n```\n\n#### `.shape` property\n\nUse `.shape` to access an object schema's property schemas.\n\n```ts\nconst Location = z.object({\n  latitude: z.number(),\n  longitude: z.number(),\n});\n\nconst Business = z.object({\n  location: Location,\n});\n\nBusiness.shape.location; // => Location schema\n```\n\n#### Merging\n\nYou can combine two object schemas with `.merge`, like so:\n\n```ts\nconst BaseTeacher = z.object({ subjects: z.array(z.string()) });\nconst HasID = z.object({ id: z.string() });\n\nconst Teacher = BaseTeacher.merge(HasId);\ntype Teacher = z.infer<typeof Teacher>; // => { subjects: string[], id: string }\n```\n\nYou're able to fluently chain together many `.merge` calls as well:\n\n```ts\n// chaining mixins\nconst Teacher = BaseTeacher.merge(HasId)\n  .merge(HasName)\n  .merge(HasAddress);\n```\n\n<!-- `.merge` is just syntactic sugar over the more generic `z.intersection` which is documented below. -->\n\n> IMPORTANT: the schema returned by `.merge` is the _intersection_ of the two schemas. The schema passed into `.merge` does not \"overwrite\" properties of the original schema. To demonstrate:\n\n```ts\nconst Obj1 = z.object({ field: z.string() });\nconst Obj2 = z.object({ field: z.number() });\n\nconst Merged = Obj1.merge(Obj2);\n\ntype Merged = z.infer<typeof merged>;\n// => { field: never }\n// because no type can simultaneously be both a string and a number\n```\n\nTo \"overwrite\" existing keys, use `.extend` (documented below).\n\n#### Extending objects\n\nYou can add additional fields an object schema with the `.extend` method.\n\n> Before zod@1.8 this method was called `.augment`. The `augment` method is still available for backwards compatibility but it is deprecated and will be removed in a future release.\n\n```ts\nconst Animal = z\n  .object({\n    species: z.string(),\n  })\n  .extend({\n    population: z.number(),\n  });\n```\n\n> ⚠️ You can use `.extend` to overwrite fields! Be careful with this power!\n\n```ts\n// overwrites `species`\nconst ModifiedAnimal = Animal.extend({\n  species: z.array(z.string()),\n});\n\n// => { population: number, species: string[] }\n```\n\n#### Masking\n\nObject masking is one of Zod's killer features. It lets you create slight variations of your object schemas easily and succinctly. Inspired by TypeScript's built-in `Pick` and `Omit` utility types, all Zod object schemas have `.pick` and `.omit` methods that return a \"masked\" version of the schema.\n\n```ts\nconst Recipe = z.object({\n  id: z.string(),\n  name: z.string(),\n  ingredients: z.array(z.string()),\n});\n```\n\nTo only keep certain keys, use `.pick`.\n\n```ts\nconst JustTheName = Recipe.pick({ name: true });\n\ntype JustTheName = z.infer<typeof JustTheName>;\n// => { name: string }\n```\n\nTo remove certain keys, use `.omit`.\n\n```ts\nconst NoIDRecipe = Recipe.omit({ id: true });\n\ntype NoIDRecipe = z.infer<typeof NoIDRecipe>;\n// => { name: string, ingredients: string[] }\n```\n\nThis is useful for database logic, where endpoints often accept as input slightly modified versions of your database schemas. For instance, the input to a hypothetical `createRecipe` endpoint would accept the `NoIDRecipe` type, since the ID will be generated by your database automatically.\n\n> This is a vital feature for implementing typesafe backend logic, yet as far as I know, no other validation library (yup, Joi, io-ts, runtypes, class-validator, ow...) offers similar functionality as of this writing (April 2020). This is one of the must-have features that inspired the creation of Zod.\n\n#### Partials\n\nInspired by the built-in TypeScript utility type [Partial](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialt), all Zod object schemas have a `.partial` method that makes all properties optional.\n\nStarting from this object:\n\n```ts\nconst user = z.object({\n  username: z.string(),\n  location: z.object({\n    latitude: z.number(),\n    longitude: z.number(),\n  }),\n});\n/*\n  { username: string, location: { city: number, state: number } }\n*/\n```\n\nWe can create a partial version:\n\n```ts\nconst partialUser = user.partial();\n/*\n{ \n  username?: string | undefined,\n  location?: {\n    city: number;\n    state: number;\n  } | undefined\n}\n*/\n\n// equivalent to:\nconst partialUser = z.object({\n  username: user.shape.username.optional(),\n  location: user.shape.location.optional(),\n});\n```\n\nOr you can use `.deepPartial`:\n\n```ts\nconst deepPartialUser = user.deepPartial();\n\n/* \n{\n  username?: string | undefined, \n  location?: {\n    latitude?: number | undefined;\n    longitude?: number | undefined;\n  } | undefined\n}\n*/\n```\n\n> Important limitation: deep partials only work as expected in hierarchies of object schemas. It also can't be used on recursive schemas currently, since creating a recursive schema requires casting to the generic `ZodSchema` type (which doesn't include all the methods of the `ZodObject` class). Currently an improved version of Zod is under development that will have better support for recursive schemas.\n\n#### Unknown keys\n\nBy default, Zod object schemas _do not_ allow unknown keys!\n\n```ts\nconst dogSchema = z.object({\n  name: z.string(),\n  neutered: z.boolean(),\n});\n\ndogSchema.parse({\n  name: 'Spot',\n  neutered: true,\n  color: 'brown',\n}); // Error(`Unexpected keys in object: 'color'`)\n```\n\nThis is an intentional decision to make Zod's behavior consistent with TypeScript. Consider this:\n\n```ts\ntype Dog = z.infer<typeof dogSchema>;\n\nconst spot: Dog = {\n  name: 'Spot',\n  neutered: true,\n  color: 'brown',\n};\n// TypeError: Object literal may only specify known\n// properties, and 'color' does not exist in type Dog\n```\n\nTypeScript doesn't allow unknown keys when assigning to an object type, so neither does Zod (by default). If you want to allow this, just call the `.nonstrict()` method on any object schema:\n\n```ts\nconst dogSchemaNonstrict = dogSchema.nonstrict();\n\ndogSchemaNonstrict.parse({\n  name: 'Spot',\n  neutered: true,\n  color: 'brown',\n}); // passes\n```\n\nThis change is reflected in the inferred type as well:\n\n```ts\ntype NonstrictDog = z.infer<typeof dogSchemaNonstrict>;\n/*\n{\n  name:string; \n  neutered: boolean;\n  [k:string]: any;\n} \n*/\n```\n\n## Records\n\nRecord schemas are used to validate types such as this:\n\n```ts\ntype NumberCache = { [k: string]: number };\n```\n\nIf you want to validate that all the _values_ of an object match some schema, without caring about the keys, you should use a Record.\n\n<!-- Records are similar to object schemas, but don't enforce a type restriction on the keys. For instance: -->\n\n<!-- ```ts\nconst objectSchema = z.object({ name: z.string() });\n``` -->\n\n<!-- `objectSchema` only accepts objects with single key: `name`. You could use `.nonstrict()` to create a schema that accepts unknown keys, but that schema doesn't enforce a type on the _values_ associated with those unknown keys. -->\n\n<!-- ```ts\nconst nonstrict = objectSchema.nonstrict();\ntype nonstrict = z.infer<typeof nonstrict>;\n// => { name: string, [k:string]: any }\n\nconst parsed = nonstrict.parse({ name: 'Serena', bar: ['whatever'] });\nparsed.bar; // no type information\n``` -->\n\n<!-- But what if you want an object that enforces a schema on all of the values it contains? That's when you would use a record. -->\n\n```ts\nconst User = z.object({\n  name: z.string(),\n});\n\nconst UserStore = z.record(User);\n\ntype UserStore = z.infer<typeof UserStore>;\n// => { [k: string]: User }\n```\n\nThis is particularly useful for storing or caching items by ID.\n\n```ts\nconst userStore: UserStore = {};\n\nuserStore['77d2586b-9e8e-4ecf-8b21-ea7e0530eadd'] = {\n  name: 'Carlotta',\n}; // passes\n\nuserStore['77d2586b-9e8e-4ecf-8b21-ea7e0530eadd'] = {\n  whatever: 'Ice cream sundae',\n}; // TypeError\n```\n\nAnd of course you can call `.parse` just like any other Zod schema.\n\n```ts\nUserStore.parse({\n  user_1328741234: { name: 'James' },\n}); // => passes\n```\n\n#### A note on numerical keys\n\nYou may have expected `z.record()` to accept two arguments, one for the keys and one for the values. After all, TypeScript's built-in Record type does: `Record<KeyType, ValueType>`. Otherwise, how do you represent the TypeScript type `Record<number, any>` in Zod?\n\nAs it turns out, TypeScript's behavior surrounding `[k: number]` is a little unintuitive:\n\n```ts\nconst testMap: { [k: number]: string } = {\n  1: 'one',\n};\n\nfor (const key in testMap) {\n  console.log(`${key}: ${typeof key}`);\n}\n// prints: `1: string`\n```\n\nAs you can see, JavaScript automatically casts all object keys to strings under the hood.\n\nSince Zod is trying to bridge the gap between static and runtime types, it doesn't make sense to provide a way of creating a record schema with numerical keys, since there's no such thing as a numerical key in runtime JavaScript.\n\n## Arrays\n\nThere are two ways to define array schemas:\n\n#### `z.array(arg: ZodSchema)`\n\nFirst, you can create an array schema with the `z.array()` function; it accepts another ZodSchema, which defines the type of each array element.\n\n```ts\nconst stringArray = z.array(z.string());\n// inferred type: string[]\n```\n\n#### the `.array()` method\n\nSecond, you can call the `.array()` method on **any** Zod schema:\n\n```ts\nconst stringArray = z.string().array();\n// inferred type: string[]\n```\n\nYou have to be careful with the `.array()` method. It returns a new `ZodArray` instance. This means you need to be careful about the _order_ in which you call methods. These two schemas are very different:\n\n```ts\nz.string()\n  .undefined()\n  .array(); // (string | undefined)[]\nz.string()\n  .array()\n  .undefined(); // string[] | undefined\n```\n\n<!-- You can define arrays of **any** other Zod schema, no matter how complicated.\n\n```ts\nconst dogsList = z.array(dogSchema);\ndogsList.parse([{ name: 'Fido', age: 4, neutered: true }]); // passes\ndogsList.parse([]); // passes\n``` -->\n\n#### Non-empty lists\n\n```ts\nconst nonEmptyStrings = z\n  .string()\n  .array()\n  .nonempty();\n// [string, ...string[]]\n\nnonEmptyStrings.parse([]); // throws: \"Array cannot be empty\"\nnonEmptyStrings.parse(['Ariana Grande']); // passes\n```\n\n#### Length validations\n\n```ts\n// must contain 5 or more items\nz.array(z.string()).min(5);\n\n// must contain 5 or fewer items\nz.array(z.string()).max(5);\n\n// must contain exactly 5 items\nz.array(z.string()).length(5);\n```\n\n## Unions\n\nZod includes a built-in `z.union` method for composing \"OR\" types.\n\n```ts\nconst stringOrNumber = z.union([z.string(), z.number()]);\n\nstringOrNumber.parse('foo'); // passes\nstringOrNumber.parse(14); // passes\n```\n\n### Optional types\n\nUnions are the basis for defining optional schemas. An \"optional string\" is just the union of `string` and `undefined`.\n\n```ts\nconst A = z.union([z.string(), z.undefined()]);\n\nA.parse(undefined); // => passes, returns undefined\ntype A = z.infer<typeof A>; // string | undefined\n```\n\nZod provides a shorthand way to make any schema optional:\n\n```ts\nconst B = z.string().optional(); // equivalent to A\n\nconst C = z.object({\n  username: z.string().optional(),\n});\ntype C = z.infer<typeof C>; // { username?: string | undefined };\n```\n\n### Nullable types\n\nSimilarly, you can create nullable types like so:\n\n```ts\nconst D = z.union([z.string(), z.null()]);\n```\n\nOr you can use the shorthand `.nullable()`:\n\n```ts\nconst E = z.string().nullable(); // equivalent to D\ntype E = z.infer<typeof D>; // string | null\n```\n\nYou can create unions of any two or more schemas.\n\n```ts\n/* Custom Union Types */\n\nconst F = z\n  .union([z.string(), z.number(), z.boolean()])\n  .optional()\n  .nullable();\n\nF.parse('tuna'); // => tuna\nF.parse(42); // => 42\nF.parse(true); // => true\nF.parse(undefined); // => undefined\nF.parse(null); // => null\nF.parse({}); // => throws Error!\n\ntype F = z.infer<typeof F>; // string | number | boolean | undefined | null;\n```\n\n### Enums\n\nAn enum is just a union of string literals, so you can \"build your own enum\" like this:\n\n```ts\nconst FishEnum = z.union([z.literal('Salmon'), z.literal('Tuna'), z.literal('Trout')]);\n\nFishEnum.parse('Salmon'); // => \"Salmon\"\nFishEnum.parse('Flounder'); // => throws\n```\n\nBut for convenience Zod provides a built-in `z.enum()` function, like so:\n\n```ts\nconst FishEnum = z.enum(['Salmon', 'Tuna', 'Trout']);\ntype FishEnum = z.infer<typeof FishEnum>;\n// 'Salmon' | 'Tuna' | 'Trout'\n```\n\n> You need to pass the literal array directly into z.enum():\n>\n> ```ts\n> const FishEnum = z.enum(['Salmon', 'Tuna', 'Trout']);\n> ```\n>\n> If you define the array as a separate variable, then pass it into z.enum, type inference won't work properly.\n\n#### Autocompletion\n\nYou can autocomplete the enum values with the `.enum` property of an enum schema:\n\n```ts\nFishEnum.enum.Salmon; // => autocompletes\n\nFishEnum.enum;\n/* \n=> {\n  Salmon: \"Salmon\",\n  Tuna: \"Tuna\",\n  Trout: \"Trout\",\n} \n*/\n```\n\nYou can also retrieve the list of options as a tuple with the `.options` property:\n\n```ts\nFishEnum.options; // [\"Salmon\", \"Tuna\", \"Trout\"]);\n```\n\n## Intersections\n\nIntersections are useful for creating \"logical AND\" types.\n\n```ts\nconst a = z.union([z.number(), z.string()]);\nconst b = z.union([z.number(), z.boolean()]);\n\nconst c = z.intersection(a, b);\ntype c = z.infer<typeof C>; // => number\n\nconst stringAndNumber = z.intersection(z.string(), z.number());\ntype Never = z.infer<typeof stringAndNumber>; // => never\n```\n\nThis is particularly useful for defining \"schema mixins\" that you can apply to multiple schemas.\n\n```ts\nconst HasId = z.object({\n  id: z.string(),\n});\n\nconst BaseTeacher = z.object({\n  name: z.string(),\n});\n\nconst Teacher = z.intersection(BaseTeacher, HasId);\n\ntype Teacher = z.infer<typeof Teacher>;\n// { id:string; name:string };\n```\n\n## Tuples\n\nThese differ from arrays in that they have a fixed number of elements, and each element can have a different type.\n\n```ts\nconst athleteSchema = z.tuple([\n  // takes an array of schemas\n  z.string(), // name\n  z.number(), // jersey number\n  z.object({\n    pointsScored: z.number(),\n  }), // statistics\n]);\n\ntype Athlete = z.infer<typeof athleteSchema>;\n// type Athlete = [string, number, { pointsScored: number }]\n```\n\n## Recursive types\n\nYou can define a recursive schema in Zod, but because of a limitation of TypeScript, their type can't be statically inferred. If you need a recursive Zod schema you'll need to define the type definition manually, and provide it to Zod as a \"type hint\".\n\n```ts\ninterface Category {\n  name: string;\n  subcategories: Category[];\n}\n\nconst Category: z.ZodSchema<Category> = z.lazy(() =>\n  z.object({\n    name: z.string(),\n    subcategories: z.array(Category),\n  }),\n);\n\nCategory.parse({\n  name: 'People',\n  subcategories: [\n    {\n      name: 'Politicians',\n      subcategories: [{ name: 'Presidents', subcategories: [] }],\n    },\n  ],\n}); // passes\n```\n\nUnfortunately this code is a bit duplicative, since you're declaring the types twice: once in the interface and again in the Zod definition.\n\nIf your schema has lots of primitive fields, there's a way of reducing the amount of duplication:\n\n```ts\n// define all the non-recursive stuff here\nconst BaseCategory = z.object({\n  name: z.string(),\n  tags: z.array(z.string()),\n  itemCount: z.number(),\n});\n\n// create an interface that extends the base schema\ninterface Category extends z.infer<typeof BaseCategory> {\n  subcategories: Category[];\n}\n\n// merge the base schema with\n// a new Zod schema containing relations\nconst Category: z.ZodSchema<Category> = BaseCategory.merge(\n  z.object({\n    subcategories: z.lazy(() => z.array(Category)),\n  }),\n);\n```\n\n#### JSON type\n\nThere isn't a built-in method for validating any JSON, because representing that requires recursive type aliases (a feature that TypeScript started supporting with version 3.7). In order to support a wider range of TypeScript versions (see the top of the README for details) we aren't providing a JSON type out of the box at this time. If you want to validate JSON and you're using TypeScript 3.7+, you can use this snippet to achieve that:\n\n```ts\ntype Literal = boolean | null | number | string;\ntype Json = Literal | { [key: string]: Json } | Json[];\nconst literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);\nconst jsonSchema: z.ZodSchema<Json> = z.lazy(() => z.union([Literal, z.array(Json), z.record(Json)]));\n\njsonSchema.parse({\n  // ...\n});\n```\n\nThanks to [ggoodman](https://github.com/ggoodman) for suggesting this.\n\n#### Cyclical objects\n\nValidation still works as expected even when there are cycles in the data.\n\n```ts\nconst cyclicalCategory: any = {\n  name: 'Category A',\n};\n\n// creating a cycle\ncyclicalCategory.subcategories = [cyclicalCategory];\n\nconst parsedCategory = Category.parse(cyclicalCategory); // parses successfully\n\nparsedCategory.subcategories[0].subcategories[0].subcategories[0];\n// => parsedCategory: Category;\n```\n\n## Promises\n\nAs of zod@1.3, there is also support for Promise schemas!\n\n```ts\nconst numberPromise = z.promise(z.number());\n```\n\n\"Parsing\" works a little differently with promise schemas. Validation happens in two parts:\n\n1. Zod synchronously checks that the input is an instance of Promise (i.e. an object with `.then` and `.catch` methods.).\n2. Zod _waits for the promise to resolve_ then validates the resolved value.\n\n```ts\nnumberPromise.parse('tuna');\n// ZodError: Non-Promise type: string\n\nnumberPromise.parse(Promise.resolve('tuna'));\n// => Promise<number>\n\nconst test = async () => {\n  await numberPromise.parse(Promise.resolve('tuna'));\n  // ZodError: Non-number type: string\n\n  await numberPromise.parse(Promise.resolve(3.14));\n  // => 3.14\n};\n```\n\n#### Non-native promise implementations\n\nWhen \"parsing\" a promise, Zod checks that the passed value is an object with `.then` and `.catch` methods — that's it. So you should be able to pass non-native Promises (Bluebird, etc) into `z.promise(...).parse` with no trouble. One gotcha: the return type of the parse function will be a _native_ `Promise`, so if you have downstream logic that uses non-standard Promise methods, this won't work.\n\n## Instanceof\n\nYou can use `z.instanceof` to create a schema that checks if the input is an instance of a class.\n\n```ts\nclass Test {\n  name: string;\n}\n\nconst TestSchema = z.instanceof(Test);\n\nconst blob: any = 'whatever';\nif (TestSchema.check(blob)) {\n  blob.name; // Test instance\n}\n```\n\n## Function schemas\n\nZod also lets you define \"function schemas\". This makes it easy to validate the inputs and outputs of a function without intermixing your validation code and \"business logic\".\n\nYou can create a function schema with `z.function(args, returnType)` which accepts these arguments.\n\n- `args: ZodTuple` The first argument is a tuple (created with `z.tuple([...])` and defines the schema of the arguments to your function. If the function doesn't accept arguments, you can pass an empty tuple (`z.tuple([])`).\n- `returnType: any Zod schema` The second argument is the function's return type. This can be any Zod schema.\n\n> You can the special `z.void()` option if your function doesn't return anything. This will let Zod properly infer the type of void-returning functions. (Void-returning function can actually return either undefined or null.)\n\n```ts\nconst args = z.tuple([z.string()]);\n\nconst returnType = z.number();\n\nconst myFunction = z.function(args, returnType);\ntype myFunction = z.infer<typeof myFunction>;\n// => (arg0: string)=>number\n```\n\nFunction schemas have an `.implement()` method which accepts a function as input and returns a new function.\n\n```ts\nconst myValidatedFunction = myFunction.implement(x => {\n  // TypeScript knows x is a string!\n  return x.trim().length;\n});\n```\n\n`myValidatedFunction` now automatically validates both its inputs and return value against the schemas provided to `z.function`. If either is invalid, the function throws.\n\nThis way you can confidently write application logic in a \"validated function\" without worrying about invalid inputs, scattering `schema.validate()` calls in your endpoint definitions,or writing duplicative types for your functions.\n\nHere's a more complex example showing how to write a typesafe API query endpoint:\n\n```ts\nconst args = z.tuple([\n  z.object({ id: z.string() }), // get by ID\n]);\n\nconst returnType = z.promise(\n  z.object({\n    id: string(),\n    name: string(),\n  }),\n);\n\nconst FetcherEndpoint = z.function(args, returnType);\n\nconst getUserByID = FetcherEndpoint.validate(args => {\n  args; // => { id: string }\n\n  const user = await User.findByID(args.id);\n\n  // TypeScript statically verifies that value returned by\n  // this function is of type Promise<{ id: string; name: string; }>\n  return 'salmon'; // TypeError\n\n  return user; // success\n});\n```\n\n> This is particularly useful for defining HTTP or RPC endpoints that accept complex payloads that require validation. Moreover, you can define your endpoints once with Zod and share the code with both your client and server code to achieve end-to-end type safety.\n\n```ts\n// Express example\nserver.get(`/user/:id`, async (req, res) => {\n  const user = await getUserByID({ id: req.params.id }).catch(err => {\n    res.status(400).send(err.message);\n  });\n\n  res.status(200).send(user);\n});\n```\n\n<!--\n## Masking\n\nMasking is one of Zod's killer features. It sets it a step ahead of most other libraries, especially those that utilize class-based validation schemas (like TypeORM). The problem with defining schemas as a class is that it's not possible to generate slight variations of it. Doing so would require high-order generics, which doesyou would need to implement a \"doubly-generic\" class factory.\n\nConsider an example where you define a `User` schema with two fields:\n\n```ts\nconst User = z.object({\n  id: z.string(),\n  name: z.string(),\n});\n```\n\nIf you want to implement a typesafe \"createUser\" function, you'll need a slightly modified version of `User` as the argument. Specifically, you'll want to get rid of the `id` field, assuming your database auto-generates IDs. Historically you'd have to define a brand-new schema, say `CreateUserInput`.\n\nIf this example sounds contrived, check out the homepage of the popular GraphQL schema definition library [TypeGraphQL](https://typegraphql.com/). The sample code shows two declarations: one for the `Recipe` model and another _nearly identical_ class for `RecipeInput` (the data type used to create new recipes). Unfortunately duplicative definitions like this are commonly needed (especially in the GraphQL ecosystem), meaning you have to keep a slew of slightly modified schemas in sync manually.\n\nZod's solution to this is \"masking\". Masking is known by a lot of other names too: _derived types_, _views_ (especially in the SQL world), _projections_, and more.\n\n\n#### Picking\n```ts\nconst User = z.object({\n  id: z.string(),\n  name: z.string(),\n});\n\nconst createUserInput = User.pick({ name: true });\n\ntype createUserInput = z.infer<typeof createUserInput>;\n// => { name: string }\n```\n\nEquivalently, you can use `.omit` to remove keys from the object schema.\n\n```ts\nconst createUserInput = User.pick({ id: true });\n\ntype createUserInput = z.infer<typeof createUserInput>;\n// => { name: string }\n```\n\n#### Nested objects\n\nMasking also works on nested object schemas:\n\n```ts\nconst User = z.object({\n  outer: z.object({\n    prop1: z.string(),\n    inner: z.object({\n      prop2: z.number(),\n    }),\n  }),\n});\n\n// picking\nUser.pick({ outer: true }); // { outer: inner: { prop1: string, prop2: number }}\nUser.pick({ outer: { prop1: true } }); // { outer: { prop1: string }}\nUser.pick({ outer: { inner: true } }); // { outer: { innfer: { prop2: number }}}\nUser.pick({ outer: { prop1: true, inner: { prop2: true } } }); // { outer: inner: { prop1: string, prop2: number }}\n\n// omiting\nUser.omit({ outer: true }); // {}\nUser.omit({ outer: { prop1: true } }); // { outer: { inner: { prop2: number }}}\nUser.omit({ outer: { inner: true } }); // { outer: { prop1: string }}\nUser.omit({ outer: { inner: { prop2: true } } }); // { outer: { prop1: string, inner: {} }}\n```\n\n\n#### Recursive schemas -->\n\n## Errors\n\nThere is a dedicated guide on Zod's error handling system here: [ERROR_HANDLING.md](https://github.com/vriad/zod/blob/master/ERROR_HANDLING.md)\n\n# Comparison\n\nThere are a handful of other widely-used validation libraries, but all of them have certain design limitations that make for a non-ideal developer experience.\n\n<!-- The table below summarizes the feature differences. Below the table there are more involved discussions of certain alternatives, where necessary. -->\n\n<!-- | Feature                                                                                                                | [Zod](https://github.com/vriad) | [Joi](https://github.com/hapijs/joi) | [Yup](https://github.com/jquense/yup) | [io-ts](https://github.com/gcanti/io-ts) | [Runtypes](https://github.com/pelotom/runtypes) | [ow](https://github.com/sindresorhus/ow) | [class-validator](https://github.com/typestack/class-validator) |\n| ---------------------------------------------------------------------------------------------------------------------- | :-----------------------------: | :----------------------------------: | :-----------------------------------: | :--------------------------------------: | :---------------------------------------------: | :--------------------------------------: | :-------------------------------------------------------------: |\n| <abbr title='Any ability to extract a TypeScript type from a validator instance counts.'>Type inference</abbr>         |               🟢                |                  🔴                  |                  🟢                   |                    🟢                    |                       🟢                        |                    🟢                    |                               🟢                                |\n| <abbr title=\"Yup's inferred types are incorrect in certain cases, see discussion below.\">Correct type inference</abbr> |               🟢                |                  🔴                  |                  🔴                   |                    🟢                    |                       🟢                        |                    🟢                    |                               🟢                                |\n\n<abbr title=\"number, string, boolean, null, undefined\">Primitive Types</abbr>\n<abbr title=\"Includes any checks beyond 'Is this a string?', e.g. min/max length, isEmail, isURL, case checking, etc.\">String Validation</abbr>\n<abbr title=\"Includes any checks beyond 'Is this a number?', e.g. min/max, isPositive, integer vs float, etc.\">Number Validation</abbr>\nDates\n\nPrimitive Literals\nObject Literals\nTuple Literals\nObjects\nArrays\nNon-empty arrays\nUnions\nOptionals\nNullable\nEnums\nEnum Autocomplete\nIntersections\nObject Merging\nTuples\nRecursive Types\nFunction Schemas\n\n<abbr title=\"For instance, Yup allows custmo error messages with the syntax yup.number().min(5, 'Number must be more than 5!')\">Validation Messages</abbr>\nImmutable instances\nType Guards\nValidity Checking\nCasting\nDefault Values\nRich Errors\nBranded -->\n\n- Missing object methods: (pick, omit, partial, deepPartial, merge, extend)\n- Missing nonempty arrays with proper typing (`[T, ...T[]]`)\n- Missing lazy/recursive types\n- Missing promise schemas\n- Missing function schemas\n- Missing union & intersection schemas\n- Missing support for parsing cyclical data (maybe)\n- Missing error customization\n\n#### Joi\n\n[https://github.com/hapijs/joi](https://github.com/hapijs/joi)\n\nDoesn't support static type inference 😕\n\n#### Yup\n\n[https://github.com/jquense/yup](https://github.com/jquense/yup)\n\nYup is a full-featured library that was implemented first in vanilla JS, with TypeScript typings added later.\n\nDifferences\n\n- Supports for casting and transformation\n- All object fields are optional by default\n- Non-standard `.required()`¹\n- Missing object methods: (pick, omit, partial, deepPartial, merge, extend)\n- Missing nonempty arrays with proper typing (`[T, ...T[]]`)\n- Missing promise schemas\n- Missing function schemas\n- Missing union & intersection schemas\n\n¹ Yup has a strange interpretation of the `.required()` is odd and non-standard. Instead of meaning \"not undefined\", Yup uses it to mean \"not empty\". So `yup.string().required()` will not accept an empty string, and `yup.array(yup.string()).required()` will not accept an empty array. For Zod arrays there is a dedicated `.nonempty()` method to indicate this, or you can implement it with a custom validator.\n\n#### io-ts\n\n[https://github.com/gcanti/io-ts](https://github.com/gcanti/io-ts)\n\nio-ts is an excellent library by gcanti. The API of io-ts heavily inspired the design of Zod.\n\nIn our experience, io-ts prioritizes functional programming purity over developer experience in many cases. This is a valid and admirable design goal, but it makes io-ts particularly hard to integrate into an existing codebase with a more procedural or object-oriented bias. For instance, consider how to define an object with optional properties in io-ts:\n\n```ts\nimport * as t from 'io-ts';\n\nconst A = t.type({\n  foo: t.string,\n});\n\nconst B = t.partial({\n  bar: t.number,\n});\n\nconst C = t.intersection([A, B]);\n\ntype C = t.TypeOf<typeof C>;\n// returns { foo: string; bar?: number | undefined }\n```\n\nYou must define the required and optional props in separate object validators, pass the optionals through `t.partial` (which marks all properties as optional), then combine them with `t.intersection`.\n\nConsider the equivalent in Zod:\n\n```ts\nconst C = z.object({\n  foo: z.string(),\n  bar: z.string().optional(),\n});\n\ntype C = z.infer<typeof C>;\n// returns { foo: string; bar?: number | undefined }\n```\n\nThis more declarative API makes schema definitions vastly more concise.\n\n`io-ts` also requires the use of gcanti's functional programming library `fp-ts` to parse results and handle errors. This is another fantastic resource for developers looking to keep their codebase strictly functional. But depending on `fp-ts` necessarily comes with a lot of intellectual overhead; a developer has to be familiar with functional programming concepts and the `fp-ts` nomenclature to use the library.\n\n- Supports codecs with serialization & deserialization transforms\n- Supports branded types\n- Supports advanced functional programming, higher-kinded types, `fp-ts` compatibility\n- Missing object methods: (pick, omit, partial, deepPartial, merge, extend)\n- Missing nonempty arrays with proper typing (`[T, ...T[]]`)\n- Missing lazy/recursive types\n- Missing promise schemas\n- Missing function schemas\n- Missing union & intersection schemas\n- Missing support for parsing cyclical data (maybe)\n- Missing error customization\n\n#### Runtypes\n\n[https://github.com/pelotom/runtypes](https://github.com/pelotom/runtypes)\n\nGood type inference support, but limited options for object type masking (no `.pick`, `.omit`, `.extend`, etc.). No support for `Record`s (their `Record` is equivalent to Zod's `object`). They DO support branded and readonly types, which Zod does not.\n\n- Supports \"pattern matching\": computed properties that distribute over unions\n- Supports readonly types\n- Missing object methods: (pick, omit, partial, deepPartial, merge, extend)\n- Missing nonempty arrays with proper typing (`[T, ...T[]]`)\n- Missing lazy/recursive types\n- Missing promise schemas\n- Missing union & intersection schemas\n- Missing error customization\n- Missing record schemas (their \"record\" is equivalent to Zod \"object\")\n\n#### Ow\n\n[https://github.com/sindresorhus/ow](https://github.com/sindresorhus/ow)\n\nOw is focused on function input validation. It's a library that makes it easy to express complicated assert statements, but it doesn't let you parse untyped data. They support a much wider variety of types; Zod has a nearly one-to-one mapping iwhtwith TypeScript's type system, whereas ow lets you validate several highly-specific types out of the box (e.g. `int32Array`, see full list in their README).\n\nIf you want to validate function inputs, use function schemas in Zod! It's a much simpler approach that lets you reuse a function type declaration without repeating yourself (namely, copy-pasting a bunch of ow assertions at the beginning of every function). Also Zod lets you validate your return types as well, so you can be sure there won't be any unexpected data passed downstream.\n\n# Changelog\n\nView the changelog at [CHANGELOG.md](https://github.com/vriad/zod/blob/master/CHANGELOG.md)\n","readmeFilename":"README.md","_id":"zod@1.10.2-canary","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"vriad","email":"colin@vriad.com"},"dist":{"integrity":"sha512-2J0BxsZfr1H7AcFemHCp4DOojcX8wpML60iIBIdrJ/zbS8oOxQzN2ITBS24RS98MNZmnilOmdugHjd0GVLayOg==","shasum":"5bccaa1f02ac87f31e9b9401e9a5791a943331b6","tarball":"http://registry-npm.ywwl.com/zod/download/zod-1.10.2-canary.tgz","fileCount":113,"unpackedSize":246443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKdleCRA9TVsSAnZWagAArMgP/Rd+oTGHQUnzKkH8e9Ca\nGS89clISEOUPJTBZw0agPj5N5qZjTz1upgAe5Fqqpq+qMe65OL/2VXku47fk\n5Oa+CGlEK9C/p26Um1FDobFLSU0ff/7cwFtODgAVsjmoYZsOEXibJY1sM2Mj\nYI/WJeDCxPWSHuupndETgQKatFJHPv9hQOXc235AQ1yezTQh0979f484cxIa\nsmU1jw7klPhcPhK33Ja6PMN1o6GiVGIai86ReApQeCCIbBRPwyQ31WuWigEV\n4Aa+PkAy+LGID4BqV4yTknRLksYfzXP8DIggsA9MkVQt88xe7fL/ek6cjo6C\n7SkD39Bbm9BkjhqdgCxZMlfCbb4+hxdq1WS9jUiWqQELeo6Y6cchGWNCMTQR\nO89bHZ/vZFB5Q+ROg3nsFM1C9vd8TmCyhYK3nYS/n0CmkB+QOCvNWAzT05Qx\nwxYEUbANyky4jo7/lOCzlbg+4sshenkRkpZYmzxWfV3vqdPUCHUgeKHCnnpB\nNj6qcgHWBwyUHC+pneUBjrYtjCWvJJktGdu7U9RyS4t/9Lf+6ZdLNs0wwMIP\nJE2kXpFAESWfB3oIR17lBF0ZQwvR1WNG2X6skJRpJwlyUTOf7VAilPCX/gYS\nKX8uM6O3PrB9kgbysA+4pLfWOhm/bAHOIMyqXvE3ta7BRMHvZyVOJTitYNcV\no5Lq\r\n=30TQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9u0YvNRwgK1qhkWWuFSI36FmIf+Qd0HKEXeiVckMJuwIgWKIkJyKDs/mHJOfnDGQ9mZ8if8y2Zphk/jEB0O1Wmv4="}],"size":52893,"noattachment":false,"key":"/zod/-/zod-1.10.2-canary.tgz"},"maintainers":[{"email":"colin@vriad.com","name":"colinmcd94"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zod_1.10.2-canary_1596578141863_0.3395884911324145"},"_hasShrinkwrap":false,"publish_time":1596578142021,"_cnpm_publish_time":1596578142021,"dist-tags":{"alpha":"3.25.68-alpha.11","beta":"4.1.13-beta.0","canary":"4.5.0-canary.20260828T171753","latest":"4.6.7","next":"3.25.0-beta.20250519T094321"}}