Appease the linter

This commit is contained in:
Travis Ralston 2019-10-31 16:27:45 -06:00
parent 11068d189c
commit 3e4a721111
8 changed files with 30 additions and 17 deletions

View file

@ -29,9 +29,15 @@ export const SERVER_RULE_TYPES = [RULE_SERVER, "org.matrix.mjolnir.rule.server"]
export const ALL_RULE_TYPES = [...USER_RULE_TYPES, ...ROOM_RULE_TYPES, ...SERVER_RULE_TYPES];
export function ruleTypeToStable(rule: string, unstable = true): string {
if (USER_RULE_TYPES.includes(rule)) return unstable ? USER_RULE_TYPES[USER_RULE_TYPES.length - 1] : RULE_USER;
if (ROOM_RULE_TYPES.includes(rule)) return unstable ? ROOM_RULE_TYPES[ROOM_RULE_TYPES.length - 1] : RULE_ROOM;
if (SERVER_RULE_TYPES.includes(rule)) return unstable ? SERVER_RULE_TYPES[SERVER_RULE_TYPES.length - 1] : RULE_SERVER;
if (USER_RULE_TYPES.includes(rule)) {
return unstable ? USER_RULE_TYPES[USER_RULE_TYPES.length - 1] : RULE_USER;
}
if (ROOM_RULE_TYPES.includes(rule)) {
return unstable ? ROOM_RULE_TYPES[ROOM_RULE_TYPES.length - 1] : RULE_ROOM;
}
if (SERVER_RULE_TYPES.includes(rule)) {
return unstable ? SERVER_RULE_TYPES[SERVER_RULE_TYPES.length - 1] : RULE_SERVER;
}
return null;
}