Add files
This commit is contained in:
commit
bb80829159
18195 changed files with 2122994 additions and 0 deletions
32
509bba0_unpacked_with_node_modules/~/fuzzysearch/index.js
generated
Executable file
32
509bba0_unpacked_with_node_modules/~/fuzzysearch/index.js
generated
Executable file
|
@ -0,0 +1,32 @@
|
|||
'use strict';
|
||||
|
||||
function fuzzysearch (needle, haystack) {
|
||||
var tlen = haystack.length;
|
||||
var qlen = needle.length;
|
||||
if (qlen > tlen) {
|
||||
return false;
|
||||
}
|
||||
if (qlen === tlen) {
|
||||
return needle === haystack;
|
||||
}
|
||||
outer: for (var i = 0, j = 0; i < qlen; i++) {
|
||||
var nch = needle.charCodeAt(i);
|
||||
while (j < tlen) {
|
||||
if (haystack.charCodeAt(j++) === nch) {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = fuzzysearch;
|
||||
|
||||
|
||||
|
||||
//////////////////
|
||||
// WEBPACK FOOTER
|
||||
// ./~/fuzzysearch/index.js
|
||||
// module id = 252
|
||||
// module chunks = 4
|
Loading…
Add table
Add a link
Reference in a new issue