Documentation

class Builder

A class that represents a validation builder for an input value.

class Builder<T = any>;

Notes

Examples

f.string()
  .optional()               // Allow undefined
  .nullable()               // Allow null
  .default("fallback")      // Provide default value
  .check(s => s.length > 0) // Custom validation
  .error("Cannot be empty") // Custom error message
  .transform(s => s.trim()) // Transform the value
  .required("Required")     // Require non-empty value

Instance members

Related