Skip to content

Function.IsNumber 1

github-actions[bot] edited this page Jun 4, 2026 · 20 revisions

umt / IsNumber

Function: IsNumber()

IsNumber(target, propertyKey): void

Defined in: Decorator/IsNumber.ts:19

Property decorator that requires the decorated field to hold a number. String representations of numbers are rejected; only genuine numbers pass. The rule is consumed by validateInstance and Validatable.

Parameters

target

object

The class prototype.

propertyKey

string | symbol

The decorated field.

Returns

void

Example

class Product {
  @IsNumber price = 0;
}

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally