mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
common: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -7,21 +7,7 @@ export const status_classes = "alert-error alert-success alert-info alert-warnin
|
||||
|
||||
export function phrase_match(query: string, phrase: string): boolean {
|
||||
// match "tes" to "test" and "stream test" but not "hostess"
|
||||
let i;
|
||||
query = query.toLowerCase();
|
||||
|
||||
phrase = phrase.toLowerCase();
|
||||
if (phrase.startsWith(query)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const parts = phrase.split(" ");
|
||||
for (i = 0; i < parts.length; i += 1) {
|
||||
if (parts[i].startsWith(query)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return (" " + phrase.toLowerCase()).includes(" " + query.toLowerCase());
|
||||
}
|
||||
|
||||
const keys_map = new Map([
|
||||
|
||||
Reference in New Issue
Block a user