Skip to content
Typeutilsv0.10.0

EachDuration

type EachDuration<TText extends string> =
    TText extends string
        ? IsPositiveWhole<Amount<TText>> extends true
            ? TText
            : `'${TText}' isn't a duration. Write a whole number above 0 and a unit (ms, s, m, h or d), like '90s' or '2h'`
        : never;