Skip to content

Function: Range()

ts
function 
Range
(
min
,
max
):
TypeFunction
<number>;

Defined in: packages/parser/src/flag-types.ts:41

Creates a range type function that validates the input is a number within the specified range.

Parameters

ParameterTypeDescription
minnumberThe minimum acceptable value (inclusive)
maxnumberThe maximum acceptable value (inclusive)

Returns

TypeFunction<number>

A TypeFunction that validates the input value

Throws

If the value is not a number or is outside the specified range

在 MIT 许可证下发布