Comparing version 0.4.1 to 0.4.2
16
index.js
@@ -1,3 +0,3 @@ | ||
Node = require('./lib/node'); | ||
PQueue = require('./lib/pqueue'); | ||
var Node = require('./lib/node'); | ||
var PQueue = require('./lib/pqueue'); | ||
@@ -8,5 +8,5 @@ /** | ||
*/ | ||
Trie = function () { | ||
var Trie = function () { | ||
this.root = new Node(); | ||
} | ||
}; | ||
@@ -24,3 +24,3 @@ /** | ||
this.root.add(item, 0); | ||
} | ||
}; | ||
@@ -44,7 +44,7 @@ /** | ||
if (!opts) { | ||
opts = {} | ||
opts = {}; | ||
} | ||
if (opts.limit == null) { | ||
opts.limit = 1/0; | ||
opts.limit = 1 / 0; | ||
} | ||
@@ -57,4 +57,4 @@ | ||
return results; | ||
} | ||
}; | ||
module.exports = Trie; |
/** | ||
* A Node in the autocompleter Trie. | ||
*/ | ||
Node = function () { | ||
var Node = function () { | ||
/* The maximum score of all the values in this element | ||
@@ -6,0 +6,0 @@ * or its children */ |
@@ -8,6 +8,6 @@ /* A PQueue with a limited size. | ||
*/ | ||
PQueue = function (limit, unique) { | ||
var PQueue = function (limit, unique) { | ||
this.todo = []; | ||
this.limit = limit; | ||
} | ||
}; | ||
@@ -50,8 +50,8 @@ PQueue.prototype.addList = function (list) { | ||
} | ||
} | ||
}; | ||
PQueue.prototype.pop = function () { | ||
return this.todo.shift(); | ||
} | ||
}; | ||
module.exports = PQueue; |
{ | ||
"name": "trie-ing", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "The trie from node-autocompleter in a form that can be used in browser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,3 +8,3 @@ The fastest weighted auto-completion trie known to me. | ||
For [Superhuman](https://superhuman.com) we're building a product focussed around speed and | ||
For [Superhuman](http://superhuman.com) we're building a product focussed around speed and | ||
productivity. To do this we need to run an auto-completer over your contacts, ordered by how | ||
@@ -11,0 +11,0 @@ recently you contacted them. |
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
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
7579263