radix-router
Advanced tools
Comparing version 0.1.0 to 0.1.1
13
index.js
@@ -11,2 +11,5 @@ 'use strict'; | ||
// no-op | ||
function noop() {} | ||
/** | ||
@@ -343,3 +346,3 @@ * Returns all children that match the prefix | ||
'startsWith': function() { | ||
return null; | ||
return []; | ||
} | ||
@@ -356,6 +359,6 @@ }; | ||
}, | ||
// no ops, (maybe | ||
'delete': function() {}, | ||
'insert': function() {}, | ||
'startsWith': function() {} | ||
// no ops, (maybe add different functionality later?) | ||
'delete': noop, | ||
'insert': noop, | ||
'startsWith': noop | ||
}; | ||
@@ -362,0 +365,0 @@ |
@@ -13,3 +13,3 @@ { | ||
"name": "radix-router", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Radix tree based router", | ||
@@ -16,0 +16,0 @@ "main": "index.js", |
@@ -41,3 +41,3 @@ const {expect} = require('chai'); | ||
expect(h2_node.children['oot']).to.not.equal(undefined); | ||
}); | ||
@@ -62,3 +62,3 @@ | ||
tree.insert('this/:route/has/:cool/stuff/**', 16); | ||
expect(tree.lookup('hello')).to.deep.equal({data: 1}); | ||
@@ -74,3 +74,3 @@ expect(tree.lookup('cool')).to.deep.equal({data: 2}); | ||
expect(tree.lookup('carbon/test1')).to.deep.equal({ | ||
data: 14, | ||
data: 14, | ||
params: { | ||
@@ -111,3 +111,3 @@ 'element': 'test1' | ||
tree.insert('choot', 7); | ||
tree.delete('choot'); | ||
@@ -138,3 +138,6 @@ expect(tree.lookup('choot')).to.deep.equal({ | ||
expect(setB.hasOwnProperty('chromium')).to.equal(true); | ||
expect(Object.keys(tree.startsWith('batman')).length).to.equal(0); | ||
}); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
47451
541
0