Comparing version 0.5.1 to 0.6.0
10
index.js
@@ -41,6 +41,6 @@ /** | ||
function parse(str) { | ||
var m = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); | ||
if (!m) return; | ||
var n = parseFloat(m[1]); | ||
var type = (m[2] || 'ms').toLowerCase(); | ||
var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str); | ||
if (!match) return; | ||
var n = parseFloat(match[1]); | ||
var type = (match[2] || 'ms').toLowerCase(); | ||
switch (type) { | ||
@@ -106,2 +106,2 @@ case 'years': | ||
return ms + ' ms'; | ||
} | ||
} |
{ | ||
"name": "ms", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "Tiny ms conversion utility", | ||
@@ -5,0 +5,0 @@ "main": "./index", |
Sorry, the diff of this file is not supported yet
3269
4
96