Comparing version 0.0.3 to 0.0.4
@@ -15,4 +15,4 @@ | ||
if (exports !== undefined) { | ||
if (module !== undefined && module.exports) { | ||
if (typeof exports !== 'undefined') { | ||
if (typeof module !== 'undefined' && module.exports) { | ||
exports = module.exports = humanize; | ||
@@ -22,3 +22,3 @@ } | ||
} else { | ||
if (define === 'function' && define.amd) { | ||
if (typeof define === 'function' && define.amd) { | ||
define('humanize', function() { | ||
@@ -43,3 +43,3 @@ return humanize; | ||
} | ||
type = (type === undefined) ? 'left' : 'right' | ||
type = (type === undefined) ? 'left' : 'right'; | ||
@@ -62,3 +62,3 @@ if (type === 'right') { | ||
return new Date().getTime() / 1000; | ||
} | ||
}; | ||
@@ -253,5 +253,5 @@ /** | ||
var sign = number < 0 ? '-' : ''; | ||
number = Math.abs(+number || 0) | ||
number = Math.abs(+number || 0); | ||
var intPart = parseInt(number.toFixed(decimals)) + ''; | ||
var intPart = parseInt(number.toFixed(decimals), 10) + ''; | ||
var j = intPart.length > 3 ? intPart.length % 3 : 0; | ||
@@ -339,3 +339,3 @@ | ||
if (seconds <= 10) { | ||
relativeTime = 'now' | ||
relativeTime = 'now'; | ||
} | ||
@@ -356,3 +356,3 @@ } else { | ||
if (seconds <= 0) { | ||
relativeTime = 'just now' | ||
relativeTime = 'just now'; | ||
} | ||
@@ -359,0 +359,0 @@ } else { |
@@ -19,7 +19,8 @@ { | ||
"main": "humanize.js", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"mocha": "1.0.3", | ||
"should": "0.6.3" | ||
"should": "0.6.3", | ||
"jshint": "0.7.1" | ||
}, | ||
@@ -31,4 +32,4 @@ "optionalDependencies": {}, | ||
"scripts": { | ||
"test": "find specs -type f -a -name *.spec.js -exec ./node_modules/mocha/bin/mocha --globals requirejsVars -R list --require should {} \\;" | ||
"test": "./node_modules/jshint/bin/hint humanize.js; find specs -type f -a -name *.spec.js -exec ./node_modules/mocha/bin/mocha --globals requirejsVars -R list --require should {} \\;" | ||
} | ||
} |
@@ -22,2 +22,5 @@ # humanize # | ||
####humanize.noConflict()#### | ||
Give control of the "humanize" variable back to its previous owner. Returns a reference to the humanize object. | ||
####humanize.time()#### | ||
@@ -24,0 +27,0 @@ Retrieves the current time in seconds |
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
33985
56
3