mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
js: Convert static/js/search_util.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
a6bf97057b
commit
8bbb0d9193
@@ -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 criteria
|
||||
where 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user