@seald-io/binary-search-tree
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@seald-io/binary-search-tree", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": { | ||
@@ -32,5 +32,2 @@ "name": "Timothée Rebours", | ||
}, | ||
"dependencies": { | ||
"underscore": "^1.13.1" | ||
}, | ||
"devDependencies": { | ||
@@ -37,0 +34,0 @@ "chai": "^4.3.4", |
@@ -9,3 +9,4 @@ # Binary search trees for Node.js | ||
Since the original maintainer doesn't support these packages anymore, we forked | ||
them and maintain them for the needs of [Seald](https://www.seald.io). | ||
them (here is [nedb](https://github.com/seald/nedb)) and maintain them for the | ||
needs of [Seald](https://www.seald.io). | ||
@@ -12,0 +13,0 @@ Two implementations of binary search |
/* eslint-env mocha */ | ||
const chai = require('chai') | ||
const AVLTree = require('../index').AVLTree | ||
const _ = require('underscore') | ||
const customUtils = require('../lib/customUtils') | ||
@@ -186,3 +185,3 @@ | ||
avlt.tree.key.should.equal(10) | ||
_.isEqual(avlt.tree.data, ['some data']).should.equal(true) | ||
assert.deepStrictEqual(avlt.tree.data, ['some data']) | ||
assert.isNull(avlt.tree.left) | ||
@@ -200,3 +199,3 @@ assert.isNull(avlt.tree.right) | ||
avlt.checkIsAVLT() | ||
_.isEqual(avlt.search(3), ['hello', 'world']).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(3), ['hello', 'world']) | ||
@@ -207,3 +206,3 @@ avlt.insert(12, 'a') | ||
avlt.checkIsAVLT() | ||
_.isEqual(avlt.search(12), ['a', 'b']).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(12), ['a', 'b']) | ||
}) | ||
@@ -224,3 +223,3 @@ | ||
avlt.checkIsAVLT() | ||
_.isEqual(avlt.search(3), ['hello']).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(3), ['hello']) | ||
@@ -236,3 +235,3 @@ avlt.insert(12, 'a') | ||
avlt.checkIsAVLT() | ||
_.isEqual(avlt.search(12), ['a']).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(12), ['a']) | ||
}) | ||
@@ -247,3 +246,3 @@ | ||
avlt.tree.key.should.equal(0) | ||
_.isEqual(avlt.tree.data, ['some data']).should.equal(true) | ||
assert.deepStrictEqual(avlt.tree.data, ['some data']) | ||
@@ -256,3 +255,3 @@ avlt = new AVLTree() | ||
avlt.tree.key.should.equal('') | ||
_.isEqual(avlt.tree.data, ['some other data']).should.equal(true) | ||
assert.deepStrictEqual(avlt.tree.data, ['some other data']) | ||
}) | ||
@@ -360,3 +359,3 @@ | ||
for (i = 0; i < 100; i += 1) { | ||
_.isEqual(avlt.search(i), ['some data for ' + i]).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(i), ['some data for ' + i]) | ||
} | ||
@@ -451,3 +450,3 @@ }) | ||
[10, 5, 3, 8, 15, 12, 37].forEach(k => { | ||
_.isEqual(avlt.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(k), ['some ' + k]) | ||
}) | ||
@@ -498,3 +497,3 @@ } | ||
avlt.tree.key.should.equal(10) | ||
_.isEqual(avlt.tree.data, ['hello']).should.equal(true) | ||
assert.deepStrictEqual(avlt.tree.data, ['hello']) | ||
avlt.getNumberOfKeys().should.equal(1) | ||
@@ -529,3 +528,3 @@ | ||
} else { | ||
_.isEqual(avlt.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(k), ['some ' + k]) | ||
} | ||
@@ -595,3 +594,3 @@ }) | ||
avlt.getNumberOfKeys().should.equal(1) | ||
_.isEqual(avlt.search(5), ['some 5']).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(5), ['some 5']) | ||
avlt.search(10).length.should.equal(0) | ||
@@ -608,3 +607,3 @@ | ||
avlt.getNumberOfKeys().should.equal(1) | ||
_.isEqual(avlt.search(15), ['some 15']).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(15), ['some 15']) | ||
avlt.search(10).length.should.equal(0) | ||
@@ -624,3 +623,3 @@ }) | ||
} else { | ||
_.isEqual(avlt.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(k), ['some ' + k]) | ||
} | ||
@@ -683,3 +682,3 @@ }) | ||
[5, 3, 8, 15, 12, 37].forEach(k => { | ||
_.isEqual(avlt.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(k), ['some ' + k]) | ||
}) | ||
@@ -698,3 +697,3 @@ avlt.search(10).length.should.equal(0) | ||
[5, 8, 15, 12, 37, 42].forEach(k => { | ||
_.isEqual(avlt.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(k), ['some ' + k]) | ||
}) | ||
@@ -717,3 +716,3 @@ avlt.search(10).length.should.equal(0) | ||
[10, 3, 1, 4, 8, 6, 9, 15, 12, 11, 13, 20, 19, 42, 3.5].forEach(k => { | ||
_.isEqual(avlt.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(k), ['some ' + k]) | ||
}) | ||
@@ -732,3 +731,3 @@ avlt.search(5).length.should.equal(0) | ||
[10, 3, 1, 4, 8, 6, 9, 5, 12, 11, 13, 20, 19, 42, 12.5].forEach(k => { | ||
_.isEqual(avlt.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(avlt.search(k), ['some ' + k]) | ||
}) | ||
@@ -1041,3 +1040,3 @@ avlt.search(15).length.should.equal(0) | ||
avlt.getNumberOfKeys().should.equal(Object.keys(data).length) | ||
_.reduce(_.map(data, d => d.length), (memo, n) => memo + n, 0).should.equal(avltDataElems.length) | ||
Object.keys(data).map(k => data[k].length).reduce((memo, n) => memo + n, 0).should.equal(avltDataElems.length) | ||
@@ -1044,0 +1043,0 @@ // Compare data |
/* eslint-env mocha */ | ||
const chai = require('chai') | ||
const BinarySearchTree = require('../index').BinarySearchTree | ||
const _ = require('underscore') | ||
const customUtils = require('../lib/customUtils') | ||
@@ -217,3 +216,3 @@ | ||
bst.key.should.equal(10) | ||
_.isEqual(bst.data, ['some data']).should.equal(true) | ||
assert.deepStrictEqual(bst.data, ['some data']) | ||
assert.isNull(bst.left) | ||
@@ -232,3 +231,3 @@ assert.isNull(bst.right) | ||
bst.left.key.should.equal(7) | ||
_.isEqual(bst.left.data, ['some other data']).should.equal(true) | ||
assert.deepStrictEqual(bst.left.data, ['some other data']) | ||
assert.isNull(bst.left.left) | ||
@@ -247,3 +246,3 @@ assert.isNull(bst.left.right) | ||
bst.right.key.should.equal(14) | ||
_.isEqual(bst.right.data, ['some other data']).should.equal(true) | ||
assert.deepStrictEqual(bst.right.data, ['some other data']) | ||
assert.isNull(bst.right.left) | ||
@@ -264,9 +263,9 @@ assert.isNull(bst.right.right) | ||
bst.left.key.should.equal(7) | ||
_.isEqual(bst.left.data, ['some other data']).should.equal(true) | ||
assert.deepStrictEqual(bst.left.data, ['some other data']) | ||
bst.left.left.key.should.equal(1) | ||
_.isEqual(bst.left.left.data, ['hello']).should.equal(true) | ||
assert.deepStrictEqual(bst.left.left.data, ['hello']) | ||
bst.left.right.key.should.equal(9) | ||
_.isEqual(bst.left.right.data, ['world']).should.equal(true) | ||
assert.deepStrictEqual(bst.left.right.data, ['world']) | ||
}) | ||
@@ -285,9 +284,9 @@ | ||
bst.right.key.should.equal(17) | ||
_.isEqual(bst.right.data, ['some other data']).should.equal(true) | ||
assert.deepStrictEqual(bst.right.data, ['some other data']) | ||
bst.right.left.key.should.equal(11) | ||
_.isEqual(bst.right.left.data, ['hello']).should.equal(true) | ||
assert.deepStrictEqual(bst.right.left.data, ['hello']) | ||
bst.right.right.key.should.equal(19) | ||
_.isEqual(bst.right.right.data, ['world']).should.equal(true) | ||
assert.deepStrictEqual(bst.right.right.data, ['world']) | ||
}) | ||
@@ -304,3 +303,3 @@ | ||
bst.left.key.should.equal(3) | ||
_.isEqual(bst.left.data, ['hello', 'world']).should.equal(true) | ||
assert.deepStrictEqual(bst.left.data, ['hello', 'world']) | ||
@@ -312,3 +311,3 @@ bst.insert(12, 'a') | ||
bst.right.key.should.equal(12) | ||
_.isEqual(bst.right.data, ['a', 'b']).should.equal(true) | ||
assert.deepStrictEqual(bst.right.data, ['a', 'b']) | ||
}) | ||
@@ -330,3 +329,3 @@ | ||
bst.left.key.should.equal(3) | ||
_.isEqual(bst.left.data, ['hello']).should.equal(true) | ||
assert.deepStrictEqual(bst.left.data, ['hello']) | ||
@@ -343,3 +342,3 @@ bst.insert(12, 'a') | ||
bst.right.key.should.equal(12) | ||
_.isEqual(bst.right.data, ['a']).should.equal(true) | ||
assert.deepStrictEqual(bst.right.data, ['a']) | ||
}) | ||
@@ -354,3 +353,3 @@ | ||
bst.key.should.equal(0) | ||
_.isEqual(bst.data, ['some data']).should.equal(true) | ||
assert.deepStrictEqual(bst.data, ['some data']) | ||
assert.isNull(bst.left) | ||
@@ -365,3 +364,3 @@ assert.isNull(bst.right) | ||
bst.key.should.equal('') | ||
_.isEqual(bst.data, ['some other data']).should.equal(true) | ||
assert.deepStrictEqual(bst.data, ['some other data']) | ||
assert.isNull(bst.left) | ||
@@ -408,3 +407,3 @@ assert.isNull(bst.right) | ||
for (i = 0; i < 100; i += 1) { | ||
_.isEqual(bst.search(i), ['some data for ' + i]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(i), ['some data for ' + i]) | ||
} | ||
@@ -499,3 +498,3 @@ }) | ||
[10, 5, 3, 8, 15, 12, 37].forEach(k => { | ||
_.isEqual(bst.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(k), ['some ' + k]) | ||
}) | ||
@@ -546,3 +545,3 @@ } | ||
bst.key.should.equal(10) | ||
_.isEqual(bst.data, ['hello']).should.equal(true) | ||
assert.deepStrictEqual(bst.data, ['hello']) | ||
bst.getNumberOfKeys().should.equal(1) | ||
@@ -576,3 +575,3 @@ | ||
} else { | ||
_.isEqual(bst.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(k), ['some ' + k]) | ||
} | ||
@@ -622,3 +621,3 @@ }) | ||
[5, 3, 6].forEach(k => { | ||
_.isEqual(bst.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(k), ['some ' + k]) | ||
}) | ||
@@ -637,3 +636,3 @@ bst.search(10).length.should.equal(0) | ||
[15, 13, 16].forEach(k => { | ||
_.isEqual(bst.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(k), ['some ' + k]) | ||
}) | ||
@@ -661,3 +660,3 @@ bst.search(10).length.should.equal(0) | ||
} else { | ||
_.isEqual(bst.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(k), ['some ' + k]) | ||
} | ||
@@ -690,3 +689,3 @@ }) | ||
[5, 3, 8, 15, 12, 37].forEach(k => { | ||
_.isEqual(bst.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(k), ['some ' + k]) | ||
}) | ||
@@ -708,3 +707,3 @@ bst.search(10).length.should.equal(0) | ||
[10, 3, 1, 4, 8, 6, 9, 15, 12, 11, 13, 20, 19, 42].forEach(k => { | ||
_.isEqual(bst.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(k), ['some ' + k]) | ||
}) | ||
@@ -722,3 +721,3 @@ bst.search(5).length.should.equal(0) | ||
[10, 5, 3, 1, 4, 8, 6, 9, 12, 11, 13, 20, 19, 42].forEach(k => { | ||
_.isEqual(bst.search(k), ['some ' + k]).should.equal(true) | ||
assert.deepStrictEqual(bst.search(k), ['some ' + k]) | ||
}) | ||
@@ -1010,3 +1009,3 @@ bst.search(15).length.should.equal(0) | ||
bst.getNumberOfKeys().should.equal(Object.keys(data).length) | ||
_.reduce(_.map(data, d => d.length), (memo, n) => memo + n, 0).should.equal(bstDataElems.length) | ||
Object.keys(data).map(k => data[k].length).reduce((memo, n) => memo + n, 0).should.equal(bstDataElems.length) | ||
@@ -1013,0 +1012,0 @@ // Compare data |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 51 instances in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
6445426
0
565
131
2501
52
- Removedunderscore@^1.13.1
- Removedunderscore@1.13.7(transitive)