Functionutilsv0.8.11
parseDuration
Parses a short duration string like 24h, 30m, 90s, 7d, or 500ms into milliseconds.
The grammar is one or more digits followed by one lowercase unit (ms, s, m, h, d). Anything else returns null, including a bare number, an unknown unit, an uppercase unit, surrounding whitespace, a fractional value, and a result of zero. A malformed input can never read as a valid duration.
input
input: stringThe duration string to parse.