class Searcher extends Events

pull/1441/head
Simon Legner 1 year ago
parent da10e5ce03
commit b6a5e388f5

@ -172,10 +172,8 @@ function scoreFuzzyMatch() {
let EMPTY_STRING = undefined; let EMPTY_STRING = undefined;
let ELLIPSIS = undefined; let ELLIPSIS = undefined;
let STRING = undefined; let STRING = undefined;
app.Searcher = class Searcher { app.Searcher = class Searcher extends Events {
static initClass() { static initClass() {
$.extend(this.prototype, Events);
CHUNK_SIZE = 20000; CHUNK_SIZE = 20000;
DEFAULTS = { DEFAULTS = {
@ -215,6 +213,7 @@ function scoreFuzzyMatch() {
} }
constructor(options) { constructor(options) {
super();
this.options = $.extend({}, DEFAULTS, options || {}); this.options = $.extend({}, DEFAULTS, options || {});
} }
@ -397,11 +396,11 @@ function scoreFuzzyMatch() {
var char = chars[i]; var char = chars[i];
chars[i] = $.escapeRegexp(char); chars[i] = $.escapeRegexp(char);
} }
return new RegExp(chars.join(".*?")); return new RegExp(chars.join(".*?")); // abc -> /a.*?b.*?c.*?/
} }
}; };
app.Searcher.initClass(); app.Searcher.initClass();
return app.Searcher; // abc -> /a.*?b.*?c.*?/ return app.Searcher;
})(); })();
app.SynchronousSearcher = class SynchronousSearcher extends app.Searcher { app.SynchronousSearcher = class SynchronousSearcher extends app.Searcher {

Loading…
Cancel
Save