Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
js: Convert static/js/search_util.js to ES6 module.
Anders Kaseorg8bbb0d91939d
diff --git a/.eslintrc.json b/.eslintrc.jsonindex ecfa8b32c1c..1f865d7b440 100644--- a/.eslintrc.json+++ b/.eslintrc.json@@ -242,7 +242,6 @@"search_pill": false,"search_pill_widget": false,"search_suggestion": false,- "search_util": false,"sent_messages": false,"server_events": false,"server_events_dispatch": false,diff --git a/frontend_tests/node_tests/subs.js b/frontend_tests/node_tests/subs.jsindex 2444c80c331..c1463e695cb 100644--- a/frontend_tests/node_tests/subs.js+++ b/frontend_tests/node_tests/subs.js@@ -12,7 +12,6 @@ const ui = set_global("ui", {get_scroll_element: (element) => element,});const stream_data = zrequire("stream_data");-zrequire("search_util");set_global("page_params", {});const denmark_stream_id = 101;diff --git a/static/js/bundles/app.js b/static/js/bundles/app.jsindex 7f5a4598a88..08cfb79fafd 100644--- a/static/js/bundles/app.js+++ b/static/js/bundles/app.js@@ -16,7 +16,6 @@ import "flatpickr/dist/plugins/confirmDate/confirmDate";import "../i18n";import "../loading";import "../vdom";-import "../search_util";import "../keydown_util";import "../lightbox_canvas";import "../rtl";diff --git a/static/js/global.d.ts b/static/js/global.d.tsindex aad0ea6f423..811a9c82df7 100644--- a/static/js/global.d.ts+++ b/static/js/global.d.ts@@ -110,7 +110,6 @@ declare let search: any;declare let search_pill: any;declare let search_pill_widget: any;declare let search_suggestion: any;-declare let search_util: any;declare let sent_messages: any;declare let server_events: any;declare let server_events_dispatch: any;diff --git a/static/js/search_util.js b/static/js/search_util.jsindex bf75258342f..24dde24bfcd 100644--- a/static/js/search_util.js+++ b/static/js/search_util.js@@ -1,14 +1,12 @@-"use strict";--exports.get_search_terms = function (input) {+export function get_search_terms(input) {const search_terms = input.toLowerCase().split(",").map((s) => s.trim());return search_terms;-};+}-exports.vanilla_match = function (opts) {+export function vanilla_match(opts) {/*This is a pretty vanilla search criteriawhere we see if any of our search terms@@ -21,6 +19,4 @@ exports.vanilla_match = function (opts) {*/const val = opts.val.toLowerCase();return opts.search_terms.some((term) => val.includes(term));-};--window.search_util = exports;+}diff --git a/static/js/subs.js b/static/js/subs.jsindex 9abe93f5e78..f9b4701f60b 100644--- a/static/js/subs.js+++ b/static/js/subs.js@@ -8,6 +8,7 @@ const render_subscription_table_body = require("../templates/subscription_table_const render_subscriptions = require("../templates/subscriptions.hbs");const people = require("./people");+const search_util = require("./search_util");const util = require("./util");exports.show_subs_pane = {