diff --git a/index.js b/index.js index 4f92771..9f1fd26 100644 --- a/index.js +++ b/index.js @@ -24,9 +24,9 @@ var y = d * 365.25; module.exports = function(val, options){ options = options || {}; if ('string' == typeof val) return parse(val); - return options.long - ? long(val) - : short(val); + return options['long'] + ? fmtLong(val) + : fmtShort(val); }; /** @@ -90,7 +90,7 @@ function parse(str) { * @api private */ -function short(ms) { +function fmtShort(ms) { if (ms >= d) return Math.round(ms / d) + 'd'; if (ms >= h) return Math.round(ms / h) + 'h'; if (ms >= m) return Math.round(ms / m) + 'm'; @@ -106,7 +106,7 @@ function short(ms) { * @api private */ -function long(ms) { +function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute')