zod
Advanced tools
Comparing version 1.2.5 to 1.2.6
@@ -37,3 +37,3 @@ import { ParseParams } from '../parser'; | ||
readonly _def: Def; | ||
parse: (x: Type, params?: ParseParams) => Type; | ||
parse: (x: Type | unknown, params?: ParseParams) => Type; | ||
is(u: Type): u is Type; | ||
@@ -40,0 +40,0 @@ check(u: Type): u is Type; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var parser_1 = require("../parser"); | ||
// import { maskUtil } from '../helpers/maskUtil'; | ||
// import { Masker } from '../masker'; | ||
// import { ZodString } from './string'; | ||
// import { maskUtil } from '../helpers/maskUtil'; | ||
var ZodTypes; | ||
@@ -9,0 +5,0 @@ (function (ZodTypes) { |
{ | ||
"name": "zod", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"description": "TypeScript-first schema declaration and validation library with static type inference", | ||
@@ -5,0 +5,0 @@ "main": "./lib/src/index.js", |
@@ -195,5 +195,5 @@ <p align="center"> | ||
```ts | ||
const Location = z.shape({ latitude: z.number(), longitude: z.number() }); | ||
const Location = z.object({ latitude: z.number(), longitude: z.number() }); | ||
const Business = z.shape({ | ||
const Business = z.object({ | ||
location: Location, | ||
@@ -324,3 +324,3 @@ }); | ||
```ts | ||
const partialUser = user.partial(); // => { username?: string | undefined } | ||
const partialUser = user.partial(); | ||
/* | ||
@@ -465,3 +465,3 @@ { | ||
You 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? | ||
You 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? | ||
@@ -468,0 +468,0 @@ As it turns out, TypeScript's behavior surrounding `[k: number]` is a little unintuitive: |
Sorry, the diff of this file is not supported yet
196986
2814