Skip to content

Function.nullable

github-actions[bot] edited this page May 5, 2026 · 32 revisions

umt / nullable

Function: nullable()

nullable<T>(validator): (value) => ValidateCoreReturnType<T | null>

Defined in: Validate/object/nullable.ts:9

Wraps a validator to accept null values

Type Parameters

T

T

The type of value the wrapped validator expects

Parameters

validator

(value) => ValidateCoreReturnType<T>

Validator function to make nullable

Returns

  • Validator that passes for null or delegates to the wrapped validator

(value) => ValidateCoreReturnType<T | null>

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally