Module

x/zod/types.ts>ZodString

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

Properties

readonly
isBase64
readonly
isCUID
readonly
isCUID2
readonly
isDate
readonly
isDatetime
readonly
isDuration
readonly
isEmail
readonly
isEmoji
readonly
isIP
readonly
isNANOID
readonly
isTime
readonly
isULID
readonly
isURL
readonly
isUUID
readonly
maxLength
readonly
minLength

Methods

protected
_regex(
regex: RegExp,
validation: StringValidation,
message?: errorUtil.ErrMessage,
)
base64(message?: errorUtil.ErrMessage)
cuid(message?: errorUtil.ErrMessage)
cuid2(message?: errorUtil.ErrMessage)
date(message?: string)
datetime(options?: string | { message?: string | undefined; precision?: number | null; offset?: boolean; local?: boolean; })
duration(message?: errorUtil.ErrMessage)
email(message?: errorUtil.ErrMessage)
emoji(message?: errorUtil.ErrMessage)
endsWith(value: string, message?: errorUtil.ErrMessage)
includes(value: string, options?: { message?: string; position?: number; })
ip(options?: string | { version?: "v4" | "v6"; message?: string; })
length(len: number, message?: errorUtil.ErrMessage)
max(maxLength: number, message?: errorUtil.ErrMessage)
min(minLength: number, message?: errorUtil.ErrMessage)
nanoid(message?: errorUtil.ErrMessage)
deprecated
nonempty(message?: errorUtil.ErrMessage)
regex(regex: RegExp, message?: errorUtil.ErrMessage)
startsWith(value: string, message?: errorUtil.ErrMessage)
time(options?: string | { message?: string | undefined; precision?: number | null; })
ulid(message?: errorUtil.ErrMessage)
url(message?: errorUtil.ErrMessage)
uuid(message?: errorUtil.ErrMessage)

Static Properties

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