simple-histogram
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,4 +0,4 @@ | ||
module.exports = (list) => { | ||
module.exports = function (list) { | ||
// build histogram | ||
var hist = Array.prototype.reduce.call(list, (acc, value) => { | ||
var hist = Array.prototype.reduce.call(list, function (acc, value) { | ||
acc[value] = (acc[value] || 0) + 1; | ||
@@ -9,3 +9,3 @@ return acc; | ||
// Sort values and return keys | ||
return Object.keys(hist).sort((a, b) => hist[b] - hist[a]) | ||
return Object.keys(hist).sort(function (a, b) { return hist[b] - hist[a]; }) | ||
// Remap the sorted key to an object | ||
@@ -12,0 +12,0 @@ .map(key => { |
{ | ||
"name": "simple-histogram", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Simple histogram utility", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
2782