Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/zod/mod.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://deno.land/x/zod@v3.17.3/mod.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

_addCheck(check: ZodStringCheck)
cuid(message?: errorUtil.ErrMessage)
email(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)
url(message?: errorUtil.ErrMessage)
uuid(message?: errorUtil.ErrMessage)

Static Properties

create: (params?: RawCreateParams) => ZodString