Skip to content

Function.Nullable 1

github-actions[bot] edited this page Jul 8, 2026 · 19 revisions

umt / Nullable

Function: Nullable()

Nullable(target, propertyKey): void

Defined in: Decorator/Nullable.ts:19

Property decorator that allows the decorated field to be null. When the value is null, the other rules on the same field are skipped.

Parameters

target

object

The class prototype.

propertyKey

string | symbol

The decorated field.

Returns

void

Example

class Profile {
  @Nullable
  @IsString
  bio: string | null = null;
}

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally