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