From 6aee4f270eef73b017bd325235b8781d463db334 Mon Sep 17 00:00:00 2001 From: evykassirer Date: Mon, 18 Mar 2024 12:30:37 -0700 Subject: [PATCH] typeahead: Simplify call to `this.source`. `this.source` will always be of type `function`, so we can remove the ternary statement. And `source` always takes one argument, so we can remove the second argument. --- web/src/bootstrap_typeahead.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/web/src/bootstrap_typeahead.js b/web/src/bootstrap_typeahead.js index a1e9fc2588..46f4511fd4 100644 --- a/web/src/bootstrap_typeahead.js +++ b/web/src/bootstrap_typeahead.js @@ -303,10 +303,7 @@ Typeahead.prototype = { return this.shown ? this.hide() : this; } - const items = - typeof this.source === "function" - ? this.source(this.query, this.process.bind(this)) - : this.source; + const items = this.source(this.query); if (!items && this.shown) { this.hide();