Skip to content

Function.LengthBetween

github-actions[bot] edited this page Jun 24, 2026 · 19 revisions

umt / LengthBetween

Function: LengthBetween()

LengthBetween(minimum, maximum): (target, propertyKey) => void

Defined in: Decorator/LengthBetween.ts:19

Property decorator factory that requires a string or array field to have a length within the inclusive range [minimum, maximum]. Values without a numeric length fail.

Parameters

minimum

number

The smallest accepted length.

maximum

number

The largest accepted length.

Returns

A property decorator.

(target, propertyKey) => void

Example

class User {
  @LengthBetween(1, 20) name = "";
}

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally