Skip to content

Function.nullable

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

umt / nullable

Function: nullable()

nullable<T, R>(validator): (value) => NullReturn | R

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

Wraps a validator to accept null values

Type Parameters

T

T

The type of value the wrapped validator expects

R

R extends object

The return type of the wrapped validator (preserved so the inner type tag flows through)

Parameters

validator

(value) => R

Validator function to make nullable

Returns

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

(value) => NullReturn | R

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally