From b6a5e388f57f8a7af87d46d8859888fba2577aec Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sat, 6 Jan 2024 13:57:51 +0100 Subject: [PATCH] class Searcher extends Events --- assets/javascripts/app/searcher.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/assets/javascripts/app/searcher.js b/assets/javascripts/app/searcher.js index bb26eeba..a52d5185 100644 --- a/assets/javascripts/app/searcher.js +++ b/assets/javascripts/app/searcher.js @@ -172,10 +172,8 @@ function scoreFuzzyMatch() { let EMPTY_STRING = undefined; let ELLIPSIS = undefined; let STRING = undefined; - app.Searcher = class Searcher { + app.Searcher = class Searcher extends Events { static initClass() { - $.extend(this.prototype, Events); - CHUNK_SIZE = 20000; DEFAULTS = { @@ -215,6 +213,7 @@ function scoreFuzzyMatch() { } constructor(options) { + super(); this.options = $.extend({}, DEFAULTS, options || {}); } @@ -397,11 +396,11 @@ function scoreFuzzyMatch() { var char = chars[i]; chars[i] = $.escapeRegexp(char); } - return new RegExp(chars.join(".*?")); + return new RegExp(chars.join(".*?")); // abc -> /a.*?b.*?c.*?/ } }; app.Searcher.initClass(); - return app.Searcher; // abc -> /a.*?b.*?c.*?/ + return app.Searcher; })(); app.SynchronousSearcher = class SynchronousSearcher extends app.Searcher {