Skip to content

API Overview

This generated reference is the exact lookup surface for Valchecker's built-in steps. Each entry comes from the step's colocated .doc.md; this page only catalogs those entries.

Use Quick Start and Core Concepts for teaching-oriented material. Use the Valchecker 1.0 Contract for cross-cutting compatibility guarantees.

Primitives

Primitive schemas and value-preserving validators, on Primitives.

Initial schemas

Loose primitives

  • looseBigint() — a bigint or a ${bigint} string, normalized to bigint
  • looseBoolean() — a boolean or "true"/"false", normalized to boolean
  • looseNumber() — a number or a ${number} string, normalized to number

Template literals

  • templateLiteral() — an assembled TypeScript template-literal type, matched as the checker matches it

Numeric validation

Date validation

  • date()Date instances, rejecting an Invalid Date
  • isAfter() — strictly after a Date bound
  • isBefore() — strictly before a Date bound

Length, emptiness, and inclusion

Equality and nullish narrowing

  • isDefined() — rejects undefined and removes it from the output, preserving null
  • isEqualTo()Object.is equality with one primitive expectation, narrowing the output to it
  • isNonNull() — rejects null and removes it from the output, preserving undefined
  • isNonNullish() — rejects null and undefined and removes both from the output
  • isOneOf()Object.is equality against a non-empty tuple of primitives, narrowing to their union

JSON strings

  • json() — a string that parses as JSON, preserving the string

String formats

Value-preserving string-format validators, on String formats.

Parsed formats

  • isEmail() — pragmatic WHATWG <input type="email"> pattern
  • isEmoji() — the UTS #51 emoji sequence grammar, or Unicode's RGI set on request
  • isIp() — IPv4 or IPv6, with range-checked octets and :: compression
  • isIsoDate() — bounded ISO YYYY-MM-DD calendar dates
  • isIsoDateTime() — bounded ISO extended calendar date-time with optional offset
  • isIsoTime() — bounded ISO HH:MM:SS time of day, with no timezone
  • isJwt() — structurally strict JWTs using JWS Compact Serialization
  • isUrl() — WHATWG URL parse with a scheme allow-list

Pattern formats

  • isBase64() — standard RFC 4648 base64 with canonical padding
  • isBase64Url() — unpadded RFC 4648 §5 base64url
  • isCuid2() — CUID2 as @paralleldrive/cuid2 produces it, capped at 32 characters
  • isHex() — one or more hexadecimal digits, with no 0x prefix
  • isHostname() — RFC 1123 hostname, labels of 1–63 characters within 253
  • isMac() — EUI-48 MAC address with : or - separators
  • isNanoid() — one or more characters of the default Nano ID alphabet
  • isUlid() — canonical 128-bit ULIDs in Crockford base32
  • isUuid() — RFC 9562 / RFC 4122 UUID, versions 1–8 plus nil and max

Structures

Composite and collection schemas, on Structures.

Object schemas

  • looseObject() — declared own properties validated, unknown own properties preserved
  • object() — declared own properties validated, unknown properties omitted from the output
  • strictObject() — declared own properties validated, unknown own string and symbol keys rejected

Collections

  • array() — every element validated and transformed in index order
  • map() — Map keys and values validated and transformed, with transformed keys kept unique
  • record() — every own enumerable entry, open or exhaustively closed by the key schema's domain
  • set() — Set items validated and transformed in insertion order, with transformed items kept unique
  • tuple() — fixed-shape array with per-position schemas and one optional rest region

Composition

  • intersection() — executes every branch and composes compatible outputs
  • union() — the first successful branch's transformed output, with registration-aware shorthand
  • variant() — direct discriminator lookup that executes only the selected branch

Class and binary instances

  • blob() — a Blob, through a feature-detected global
  • file() — a File, through a feature-detected global
  • instance() — an instanceof check against a class

Collection size and membership

Media types

  • isMimeType() — a value's type string against allowed MIME types, with image/* wildcards

Transforms

Output transformations, on Transforms.

String transforms

Array transforms

Collection transforms

JSON transforms

Primitive conversions

  • toBigint() — native BigInt(value) conversion
  • toBoolean() — native Boolean(value) truthiness conversion
  • toDate()Date from epoch milliseconds or any string accepted by new Date(value)
  • toMappedBoolean() — explicit true/false value mappings for string, number, or bigint
  • toNumber() — native Number(value) conversion
  • toSafeNumber() — bigint to number, only within the safe integer range

General conversion

  • toString() — convert a value through its own toString method

Helpers and utilities

Flow control, escape hatches, execution-mode steps, and type-level utilities, on Helpers & Utilities.

Escape hatches

  • check() — generic custom validation escape hatch
  • transform() — generic custom output transformation escape hatch

Flow control

  • fallback() — recover earlier validation and operation failures; internal issues are fatal
  • use() — delegate to another schema

Type-level utilities

  • as() — compile-time assertion with no runtime validation
  • generic() — lazy or recursive schema construction

Execution mode

  • toAsync() — force the complete schema to return a native promise