Fast SublimeText-like fuzzy search for collections
Thanks to @farzher for fuzzysort
Installation
$ npm install --save fuzzysort-collection
Usage
const fuzz = ; // You can config fuzzysort options:// https://github.com/farzher/fuzzysort#optionsfuzzfuzzysorthighlightOpen = '<strong>';fuzzfuzzysorthighlightClose = '</strong>'; const crop = a: b: 'Snap' a: b: 'Paypal' a: b: 'Google' a: b: 'Apple' ; let cream = ;/*[ { "meta": { "matches": [ 0, 1 ], "target": "Apple", "lower": "apple", "score": 3, "theMatches": [ 0, 1 ], "highlighted": "<strong>Ap</strong>ple" }, "data": { "a": { "b": "Apple" } } }, { "meta": { "matches": [ 2, 3 ], "target": "Snap", "lower": "snap", "score": 2002, "theMatches": [ 2, 3 ], "highlighted": "Sn<strong>ap</strong>" }, "data": { "a": { "b": "Snap" } } }, { "meta": { "matches": [ 1, 3 ], "target": "Paypal", "lower": "paypal", "score": 4004, "theMatches": [ 1, 3 ], "highlighted": "P<strong>a</strong>y<strong>p</strong>al" }, "data": { "a": { "b": "Paypal" } } }]*/
License
ISC © Buster Collings