client/components/rauchg/ms.js/0.7.0/index.js
Function parse
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parse(str) {
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
if (!match) return;
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
Avoid too many return
statements within this function. Open
Open
return ms + 'ms';