We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I added ms to let Ops configure some intervals on their ~/config/local.yaml in a human-readable fashion.
ms
~/config/local.yaml
The ops tried:
app: interval: 1h 30min
This evidently did not behave as expected.
const ms = require('ms'); const v = ms('1h 30min') console.log(v)
5400000
undefined
The text was updated successfully, but these errors were encountered:
Workaround: parse every part by yourself, and sum the elements
const s = '1h 30min'; const v = s.replace(/([0-9])[ \t]+([^ \t])/g, (_, digit, char) => `${digit}${char}`) .trim().split(/[ \t]+/) .map(val => parse(val)).reduce((a,b) => a + b);
Sorry, something went wrong.
ms('1h') + ms('30m') is the best workaround.
ms('1h') + ms('30m')
Colons are probably better like this feature request #24
Parse errors are suggested in feature request #123
No branches or pull requests
Use-Case Overview
I added
ms
to let Ops configure some intervals on their~/config/local.yaml
in a human-readable fashion.The ops tried:
This evidently did not behave as expected.
Reproduction steps:
expected behavior
found behavior
The text was updated successfully, but these errors were encountered: