Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
- deps: ms@0.7.0
- feat: warn with stack
  • Loading branch information
dead-horse committed May 20, 2016
1 parent e584c58 commit 627c5c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
12 changes: 11 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down

0 comments on commit 627c5c4

Please sign in to comment.