Socket
Socket
Sign inDemoInstall

hasharray

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hasharray - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

2

package.json

@@ -6,3 +6,3 @@ {

"description": "A data structure that combines a hash and an array for CRUD operations by object keys or index.",
"version": "0.1.8",
"version": "0.1.9",
"main": "index.js",

@@ -9,0 +9,0 @@ "url": "https://github.com/joshjung/hash-array",

@@ -214,4 +214,5 @@ var JClass = require('jclass');

sum: function(keys, key, weightKey) {
var ret = 0;
this.forEachDeep(keys, key, function (value) {
var self = this,
ret = 0;
this.forEachDeep(keys, key, function (value, item) {
if (weightKey !== undefined)

@@ -218,0 +219,0 @@ value *= self.find(item, weightKey);

@@ -499,2 +499,6 @@ var assert = require('assert'),

});
it('should work with weighted sums.', function() {
assert.equal(ha.sum('boat', ['data', 'speed'], ['data', 'weight']), (10 * 100000) + (5 * 200000));
});
});

@@ -501,0 +505,0 @@

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