Skip to main content
Defined in: guardrails/types.ts:197 Converts a Duration to milliseconds. Accepts a non-negative number (already in milliseconds) or a shorthand string: "500ms", "30s", "5m", "1h", "24h", "7d".

Parameters

input

Duration The duration value to parse.

Returns

number The duration in milliseconds.

Throws

"amount_unparseable" if the input can’t be parsed.