https://github.com/stevendesu/jsindex
The premise is this:
Given a collection in JavaScript (an array of objects, each of which has the same keys) this library will build a simple index - pre-filtering all records by their key values.
This enables:
1. Constant-time searching for records with a certain collection of values -- down from the O(n) solution that is Array.prototype.filter() 2. Linear-time joining (left, right, inner, and outer join) of collections -- down from the O(n^2) solution of iterating over one array and using Array.prototype.filter() on the other
The library isn't 100% finished, but I'll keep working on it during my spare time. I'm also open to any suggestions or contributions. I was just really proud of it and wanted to see if anyone could use what I had built.
I plan to publish the library to NPM shortly (maybe tonight). I've just been too busy and kind of wanted to finish up all of the array function overrides first. Currently I've done the overrides for Array.push and Array.splice, but none of the others (Array.pop, Array.shift, Array.unshift, Array.concat)