ZodTypeAny.isOptional: Try safe-parsing `undefined` (this is what `isOptional` does internally): ```ts const schema = z.string().optional(); const isOptional = schema.safeParse(undefined).success; // true ```
ZodTypeAny.isNullable: Try safe-parsing `null` (this is what `isNullable` does internally): ```ts const schema = z.string().nullable(); const isNullable = schema.safeParse(null).success; // true ```
ZodType.isOptional: Try safe-parsing `undefined` (this is what `isOptional` does internally): ```ts const schema = z.string().optional(); const isOptional = schema.safeParse(undefined).success; // true ```
ZodType.isNullable: Try safe-parsing `null` (this is what `isNullable` does internally): ```ts const schema = z.string().nullable(); const isNullable = schema.safeParse(null).success; // true ```
ZodString.email: Use `z.email()` instead.
ZodString.url: Use `z.url()` instead.
ZodString.emoji: Use `z.emoji()` instead.
ZodString.uuid: Use `z.uuid()` instead.
ZodString.nanoid: Use `z.nanoid()` instead.
ZodString.cuid: CUID v1 is deprecated by its authors due to information leakage (timestamps embedded in the id). Use `z.cuid2()` instead. See https://github.com/paralleldrive/cuid.
ZodString.cuid2: Use `z.cuid2()` instead.
ZodString.ulid: Use `z.ulid()` instead.
ZodString.base64: Use `z.base64()` instead.
ZodString.base64url: Use `z.base64url()` instead.
ZodString.jwt: Use `z.jwt()` instead.
ZodString.datetime: Use `z.iso.datetime()` instead.
ZodString.date: Use `z.iso.date()` instead.
ZodString.time: Use `z.iso.time()` instead.
ZodString.duration: Use `z.iso.duration()` instead.
ZodString.isOptional: Try safe-parsing `undefined` (this is what `isOptional` does internally): ```ts const schema = z.string().optional(); const isOptional = schema.safeParse(undefined).success; // true ```
ZodString.isNullable: Try safe-parsing `null` (this is what `isNullable` does internally): ```ts const schema = z.string().nullable(); const isNullable = schema.safeParse(null).success; // true ```
ZodNumber.step: Use `.multipleOf()` instead.
ZodNumber.finite: In v4 and later, z.number() does not allow infinite values by default. This is a no-op.
ZodNumber.safe: This is now identical to `.int()`. Only numbers in the safe integer range are accepted.
ZodNumber.isInt: Check the `format` property instead.
ZodNumber.isFinite: Number schemas no longer accept infinite values, so this always returns `true`.
ZodNumber.isOptional: Try safe-parsing `undefined` (this is what `isOptional` does internally): ```ts const schema = z.string().optional(); const isOptional = schema.safeParse(undefined).success; // true ```
ZodNumber.isNullable: Try safe-parsing `null` (this is what `isNullable` does internally): ```ts const schema = z.string().nullable(); const isNullable = schema.safeParse(null).success; // true ```
ZodBigInt.isOptional: Try safe-parsing `undefined` (this is what `isOptional` does internally): ```ts const schema = z.string().optional(); const isOptional = schema.safeParse(undefined).success; // true ```
ZodBigInt.isNullable: Try safe-parsing `null` (this is what `isNullable` does internally): ```ts const schema = z.string().nullable(); const isNullable = schema.safeParse(null).success; // true ```
ZodBoolean.isOptional: Try safe-parsing `undefined` (this is what `isOptional` does internally): ```ts const schema = z.string().optional(); const isOptional = schema.safeParse(undefined).success; // true ```
ZodBoolean.isNullable: Try safe-parsing `null` (this is what `isNullable` does internally): ```ts const schema = z.string().nullable(); const isNullable = schema.safeParse(null).success; // true ```
ZodDate.minDate: Not recommended.
ZodDate.maxDate: Not recommended.
ZodDate.isOptional: Try safe-parsing `undefined` (this is what `isOptional` does internally): ```ts const schema = z.string().optional(); const isOptional = schema.safeParse(undefined).success; // true ```
ZodDate.isNullable: Try safe-parsing `null` (this is what `isNullable` does internally): ```ts const schema = z.string().nullable(); const isNullable = schema.safeParse(null).success; // true ```