Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-histogram

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-histogram - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc