fix(xo-server/_parseDuration): add missing file

Related to 6baef2450
This commit is contained in:
Julien Fontanet
2019-03-22 16:19:09 +01:00
parent 1e642fc512
commit 00436e744a

View File

@@ -0,0 +1,12 @@
import ms from 'ms'
export default value => {
if (typeof value === 'number') {
return value
}
const duration = ms(value)
if (duration === undefined) {
throw new TypeError(`not a valid duration: ${duration}`)
}
return duration
}