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

binary-search-tree

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binary-search-tree - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

2

lib/avltree.js

@@ -352,3 +352,3 @@ /**

// Delete only a value (no tree modification)
if (currentNode.data.length > 1 && value) {
if (currentNode.data.length > 1 && value !== undefined) {
currentNode.data.forEach(function (d) {

@@ -355,0 +355,0 @@ if (!currentNode.checkValueEquality(d, value)) { newData.push(d); }

{
"name": "binary-search-tree",
"version": "0.2.5",
"version": "0.2.6",
"author": {

@@ -5,0 +5,0 @@ "name": "Louis Chatriot",

@@ -18,2 +18,4 @@ # Binary search trees for Node.js

Values inserted can be anything except `undefined`.
```javascript

@@ -20,0 +22,0 @@ var BinarySearchTree = require('binary-search-tree').BinarySearchTree

@@ -825,2 +825,19 @@ var should = require('chai').should()

it("Removing falsy values does not delete the entire key", function () {
var avlt = new AVLTree();
avlt.insert(10, 2);
avlt.insert(10, 1);
assert.deepEqual(avlt.search(10), [2, 1]);
avlt.delete(10, 2);
assert.deepEqual(avlt.search(10), [1]);
avlt.insert(10, 0);
assert.deepEqual(avlt.search(10), [1, 0]);
avlt.delete(10, 0);
assert.deepEqual(avlt.search(10), [1]);
});
}); // ==== End of 'Deletion' ==== //

@@ -827,0 +844,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