humanize-duration
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -15,4 +15,8 @@ /* | ||
// Turn Number objects into primitives. | ||
if (ms instanceof Number) | ||
ms = ms.valueOf(); | ||
// Humanizing zero, I see. | ||
if (ms == 0) | ||
if (ms === 0) | ||
return "0"; | ||
@@ -109,3 +113,3 @@ | ||
year: function(c) { return "an" + ((c !== 1) ? "s" : ""); }, | ||
month: function(c) { return "mois"; }, | ||
month: function() { return "mois"; }, | ||
week: function(c) { return "semaine" + ((c !== 1) ? "s" : ""); }, | ||
@@ -120,3 +124,3 @@ day: function(c) { return "jour" + ((c !== 1) ? "s" : ""); }, | ||
year: function(c) { return "ano" + ((c !== 1) ? "s" : ""); }, | ||
month: function(c) { return "mês"((c !== 1) ? "es" : ""); }, | ||
month: function(c) { return "mês" + ((c !== 1) ? "es" : ""); }, | ||
week: function(c) { return "semana" + ((c !== 1) ? "s" : ""); }, | ||
@@ -130,10 +134,10 @@ day: function(c) { return "dia" + ((c !== 1) ? "s" : ""); }, | ||
ko: { | ||
year: function(c) { return "년"; }, | ||
month: function(c) { return "개월"; }, | ||
week: function(c) { return "주일"; }, | ||
day: function(c) { return "일"; }, | ||
hour: function(c) { return "시간"; }, | ||
minute: function(c) { return "분"; }, | ||
second: function(c) { return "초"; }, | ||
millisecond: function(c) { return "밀리 초"; } | ||
year: function() { return "년"; }, | ||
month: function() { return "개월"; }, | ||
week: function() { return "주일"; }, | ||
day: function() { return "일"; }, | ||
hour: function() { return "시간"; }, | ||
minute: function() { return "분"; }, | ||
second: function() { return "초"; }, | ||
millisecond: function() { return "밀리 초"; } | ||
} | ||
@@ -140,0 +144,0 @@ }; |
{ | ||
"name": "humanize-duration", | ||
"author": "Evan Hahn", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Convert millisecond durations to English (or a few other languages).", | ||
"main": "humanize-duration.js", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "./node_modules/mocha/bin/mocha" | ||
}, | ||
"devDependencies": { | ||
"chai": "*", | ||
"sugar": "*" | ||
"mocha": "1.14.x", | ||
"chai": "1.8.x", | ||
"sugar": "1.4.x" | ||
}, | ||
@@ -25,2 +26,27 @@ "keywords": [ | ||
], | ||
"jshintConfig": { | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": false, | ||
"eqeqeq": false, | ||
"es3": true, | ||
"freeze": true, | ||
"immed": true, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": true, | ||
"nonew": true, | ||
"plusplus": false, | ||
"quotmark": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": false, | ||
"trailing": true, | ||
"predef": [ | ||
"module", | ||
"require", | ||
"describe", "it", "beforeEach" | ||
] | ||
}, | ||
"repository": { | ||
@@ -27,0 +53,0 @@ "type": "git", |
@@ -1,2 +0,4 @@ | ||
"use strict"; | ||
/* We'll test things with the Number object, | ||
which JSHint shouldn't complain about. */ | ||
/* jshint -W053 */ | ||
@@ -11,2 +13,4 @@ var chai = require("chai"); | ||
"use strict"; | ||
beforeEach(function() { | ||
@@ -138,2 +142,12 @@ humanizing.language = "en"; | ||
it("works with Number objects with a value of 0", function() { | ||
var duration = new Number(0); | ||
humanizing(duration).should.equal("0"); | ||
}); | ||
it("works with non-zero Number objects", function() { | ||
var duration = new Number(61000); | ||
humanizing(duration).should.equal("1 minute, 1 second"); | ||
}); | ||
it("keeps Number objects intact", function() { | ||
@@ -140,0 +154,0 @@ var duration = new Number(2012); |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
var chai = require("chai"); | ||
@@ -11,2 +9,4 @@ var humanizing = require("../humanize-duration"); | ||
"use strict"; | ||
beforeEach(function() { | ||
@@ -13,0 +13,0 @@ humanizing.language = "en"; |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
var chai = require("chai"); | ||
@@ -11,2 +9,4 @@ var humanizing = require("../humanize-duration"); | ||
"use strict"; | ||
beforeEach(function() { | ||
@@ -13,0 +13,0 @@ humanizing.language = "ko"; |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
var chai = require("chai"); | ||
@@ -11,2 +9,4 @@ var humanizing = require("../humanize-duration"); | ||
"use strict"; | ||
beforeEach(function() { | ||
@@ -13,0 +13,0 @@ humanizing.language = "en"; |
@@ -1,3 +0,1 @@ | ||
"use strict"; | ||
var chai = require("chai"); | ||
@@ -11,2 +9,4 @@ var humanizing = require("../humanize-duration"); | ||
"use strict"; | ||
beforeEach(function() { | ||
@@ -13,0 +13,0 @@ humanizing.language = "en"; |
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
23846
446
3