Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: node-modules/humanize-ms
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e8bc10a223adeffe114966abc69b75e1f999ab65
Choose a base ref
...
head repository: node-modules/humanize-ms
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d9cdffe02c748b3e05490496ce18530b966154f0
Choose a head ref
  • 5 commits
  • 4 files changed
  • 3 contributors

Commits on May 20, 2016

  1. Release 1.2.0

    - deps: ms@0.7.0
    - feat: warn with stack
    dead-horse committed May 20, 2016
    Copy the full SHA
    627c5c4 View commit details

Commits on Feb 20, 2017

  1. Add license text (#2)

    tomhughes authored and dead-horse committed Feb 20, 2017
    Copy the full SHA
    51a95e8 View commit details

Commits on May 19, 2017

  1. fix: package.json to reduce vulnerabilities (#3)

    The following vulnerabilities are fixed with an upgrade:
    - https://snyk.io/vuln/npm:ms:20170412
    
    Latest report for node-modules/humanize-ms:
    https://snyk.io/test/github/node-modules/humanize-ms
    snyk-bot authored and dead-horse committed May 19, 2017
    Copy the full SHA
    3b6f1ba View commit details
  2. deps: ms@2

    dead-horse committed May 19, 2017
    Copy the full SHA
    c6da77c View commit details
  3. Release 1.2.1

    dead-horse committed May 19, 2017
    Copy the full SHA
    d9cdffe View commit details
Showing with 43 additions and 5 deletions.
  1. +16 −1 History.md
  2. +17 −0 LICENSE
  3. +5 −1 index.js
  4. +5 −3 package.json
17 changes: 16 additions & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@

1.0.1 / 2014-12-31
1.2.1 / 2017-05-19
==================

* fix: package.json to reduce vulnerabilities (#3)

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
17 changes: 17 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -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;
};
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "humanize-ms",
"version": "1.0.1",
"version": "1.2.1",
"description": "transform humanize time to ms",
"main": "index.js",
"files": ["index.js"],
"files": [
"index.js"
],
"scripts": {
"test": "make test"
},
@@ -22,7 +24,7 @@
},
"license": "MIT",
"dependencies": {
"ms": "~0.7.0"
"ms": "^2.0.0"
},
"devDependencies": {
"autod": "*",