js: Convert static/js/filter.js to ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-27 15:45:40 -08:00
committed by Tim Abbott
parent 16668904c1
commit cfacf68fb8
33 changed files with 46 additions and 35 deletions

View File

@@ -1,10 +1,8 @@
"use strict";
import Handlebars from "handlebars/runtime";
import _ from "lodash";
const Handlebars = require("handlebars/runtime");
const _ = require("lodash");
const people = require("./people");
const util = require("./util");
import * as people from "./people";
import * as util from "./util";
function zephyr_stream_name_match(message, operand) {
// Zephyr users expect narrowing to "social" to also show messages to /^(un)*social(.d)*$/
@@ -174,7 +172,7 @@ function message_matches_search_term(message, operator, operand) {
return true; // unknown operators return true (effectively ignored)
}
class Filter {
export class Filter {
constructor(operators) {
if (operators === undefined) {
this._operators = [];
@@ -982,7 +980,3 @@ class Filter {
return Handlebars.Utils.escapeExpression(Filter.describe_unescaped(operators));
}
}
module.exports = Filter;
window.Filter = Filter;