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.1.1 to 0.1.2

5

lib/bst.js

@@ -205,3 +205,6 @@ /**

if (this.unique) {
throw "Can't insert key " + key + ", it violates the unique constraint";
throw { message: "Can't insert key " + key + ", it violates the unique constraint"
, key: key
, errorType: 'uniqueViolated'
};
} else {

@@ -208,0 +211,0 @@ this.data.push(value);

2

package.json
{
"name": "binary-search-tree",
"version": "0.1.1",
"version": "0.1.2",
"author": {

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

@@ -301,3 +301,8 @@ var should = require('chai').should()

bst.insert(3, 'hello');
(function () { bst.insert(3, 'world'); }).should.throw();
try {
bst.insert(3, 'world');
} catch (e) {
e.errorType.should.equal('uniqueViolated');
e.key.should.equal(3);
}

@@ -309,3 +314,8 @@ bst.checkIsBST();

bst.insert(12, 'a');
(function () { bst.insert(12, 'b'); }).should.throw();
try {
bst.insert(12, 'world');
} catch (e) {
e.errorType.should.equal('uniqueViolated');
e.key.should.equal(12);
}

@@ -312,0 +322,0 @@ bst.checkIsBST();

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