Comparing version 0.0.9 to 0.0.10
38
index.js
@@ -19,3 +19,3 @@ /* eslint-disable no-console */ | ||
const timeParamRE = /^(\d+)([dhms]$)/i; | ||
const timeParamRE = /^(\d+)\s*(years?|y|months?|mo|weeks?|w|days?|d|hours?|h|minutes?|min|m|seconds?|sec|s|milliseconds?|millis|ms)$/i; | ||
@@ -434,14 +434,48 @@ module.exports = { | ||
let sec = 0; | ||
switch (dhms.toLowerCase()) { | ||
case 'y': | ||
case 'year': | ||
case 'years': | ||
sec = 365 * 24 * 3600 * nn; | ||
break; | ||
case 'mo': | ||
case 'month': | ||
case 'months': | ||
sec = 30 * 24 * 3600 * nn; | ||
break; | ||
case 'w': | ||
case 'week': | ||
case 'weeks': | ||
sec = 7 * 24 * 3600 * nn; | ||
break; | ||
case 'd': | ||
case 'day': | ||
case 'days': | ||
sec = 24 * 3600 * nn; | ||
break; | ||
case 'h': | ||
case 'hour': | ||
case 'hours': | ||
sec = 3600 * nn; | ||
break; | ||
case 'm': | ||
case 'min': | ||
case 'minute': | ||
case 'minutes': | ||
sec = 60 * nn; | ||
break; | ||
case 's': | ||
case 'sec': | ||
case 'second': | ||
case 'seconds': | ||
sec = nn; | ||
break; | ||
case 'ms': | ||
case 'millis': | ||
case 'millisecond': | ||
case 'milliseconds': | ||
return +nn; | ||
default: | ||
sec = nn; | ||
return +nn; | ||
} | ||
@@ -448,0 +482,0 @@ return sec * 1000; |
{ | ||
"name": "af-fns", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "A highly specialized function library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14050
448