Module

x/zod/index.ts>ZodString

TypeScript-first schema validation with static type inference
Extremely Popular
Go to Latest
class ZodString
extends ZodType<string, ZodStringDef>
import { ZodString } from "https://dotland.deno.dev/x/zod@v3.20/index.ts";

Properties

protected
_regex: (
regex: RegExp,
validation: StringValidation,
message?: errorUtil.ErrMessage,
) => unknown
readonly
isCUID
readonly
isEmail
readonly
isURL
readonly
isUUID
readonly
maxLength
readonly
minLength
deprecated
nonempty: (message?: errorUtil.ErrMessage) => unknown
trim: () => unknown

Methods

cuid(message?: errorUtil.ErrMessage)
datetime(options?: string | { message?: string | undefined; precision?: number | null; offset?: boolean; })
email(message?: errorUtil.ErrMessage)
endsWith(value: string, message?: errorUtil.ErrMessage)
length(len: number, message?: errorUtil.ErrMessage)
max(maxLength: number, message?: errorUtil.ErrMessage)
min(minLength: number, message?: errorUtil.ErrMessage)
regex(regex: RegExp, message?: errorUtil.ErrMessage)
startsWith(value: string, message?: errorUtil.ErrMessage)
url(message?: errorUtil.ErrMessage)
uuid(message?: errorUtil.ErrMessage)

Static Properties

create: (params?: RawCreateParams & { coerce?: true; }) => ZodString