diff --git a/History.md b/History.md index 4ee5dbf..b1729db 100644 --- a/History.md +++ b/History.md @@ -1,5 +1,15 @@ -1.0.1 / 2014-12-31 +1.2.0 / 2016-05-21 +================== + + * feat: warn with stack + +1.1.0 / 2016-04-04 +================== + + * deps: upgrade ms to 0.7.0 + +1.0.1 / 2014-12-31 ================== * feat(index.js): warn when result is undefined diff --git a/index.js b/index.js index c2423f1..660df81 100644 --- a/index.js +++ b/index.js @@ -10,11 +10,15 @@ * Module dependencies. */ +var util = require('util'); var ms = require('ms'); module.exports = function (t) { if (typeof t === 'number') return t; var r = ms(t); - if (r === undefined) console.warn('ms(%j) got undefined in %s', t, __filename); + if (r === undefined) { + var err = new Error(util.format('humanize-ms(%j) result undefined', t)); + console.warn(err.stack); + } return r; }; diff --git a/package.json b/package.json index ce67b35..f9f6fbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "humanize-ms", - "version": "1.0.1", + "version": "1.2.0", "description": "transform humanize time to ms", "main": "index.js", "files": ["index.js"],