Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
typeahead: Replace ~ operator with includes().
evykassirerb034875216f5
diff --git a/web/third/bootstrap-typeahead/typeahead.js b/web/third/bootstrap-typeahead/typeahead.jsindex 5d8d7e8f591..f6353e0e6be 100644--- a/web/third/bootstrap-typeahead/typeahead.js+++ b/web/third/bootstrap-typeahead/typeahead.js@@ -340,7 +340,7 @@ import {get_string_diff} from "../../src/util";},matcher(item) {- return ~item.toLowerCase().indexOf(this.query.toLowerCase());+ return item.toLowerCase().includes(this.query.toLowerCase());},sorter(items) {@@ -352,7 +352,7 @@ import {get_string_diff} from "../../src/util";while ((item = items.shift())) {if (!item.toLowerCase().indexOf(this.query.toLowerCase())) {beginswith.push(item);- } else if (~item.indexOf(this.query)) {+ } else if (item.includes(this.query)) {caseSensitive.push(item);} else {caseInsensitive.push(item);@@ -513,7 +513,7 @@ import {get_string_diff} from "../../src/util";e.preventDefault();this.select(e);}- this.suppressKeyPressRepeat = !~$.inArray(pseudo_keycode, [40, 38, 9, 13, 27]);+ this.suppressKeyPressRepeat = ![40, 38, 9, 13, 27].includes(pseudo_keycode);this.move(e);},