Skip to content

Function.Max 1

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

umt / Max

Function: Max()

Max(maximum): (target, propertyKey) => void

Defined in: Decorator/Max.ts:19

Property decorator factory that requires a numeric field to be less than or equal to maximum. Non-numeric values fail. Reuses the existing maxValue validator.

Parameters

maximum

number

The largest accepted value.

Returns

A property decorator.

(target, propertyKey) => void

Example

class Rating {
  @Max(5) stars = 0;
}

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally