Skip to content

Function.lengthBetween

github-actions[bot] edited this page Nov 18, 2026 · 13 revisions

umt / lengthBetween

Function: lengthBetween()

lengthBetween(min, max, message?): ValidateReturnType<string>

Defined in: Validate/string/lengthBetween.ts:15

Creates a validator for checking if a string's length is greater than or equal to a minimum value and less than or equal to a maximum value

Parameters

min

number

Minimum allowed length of the string (inclusive)

max

number

Maximum allowed length of the string (inclusive)

message?

string

Custom error message for validation failure

Returns

ValidateReturnType<string>

  • Validator for inclusive string length range

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally