Skip to main content

Function: toTimeoutMilliseconds()

function toTimeoutMilliseconds(value: number): TimeoutMilliseconds;

Defined in: shared/types/units.ts:89

Brands a validated number as a TimeoutMilliseconds value.

Parametersโ€‹

valueโ€‹

number

Millisecond duration to brand. Must be finite and non-negative.

Returnsโ€‹

TimeoutMilliseconds

The branded timeout duration.

Throwsโ€‹

RangeError When the value is negative or not finite.