This highlight the fact that it's not designed for direct consumption and it no longer needs a special handling in `npmignore`.
290 B
290 B
ms without magic: always parse a duration and throws if invalid.
import { parseDuration } from '@vates/parse-duration'
parseDuration('2 days')
// 172800000
parseDuration(172800000)
// 172800000
parseDuration(undefined)
// throws TypeError('not a valid duration: undefined')