replace all var with let (reduces warnings)
3 files changed, 8 insertions, 8 deletions
diff --git a/api/src/util/handlers/Message.ts b/api/src/util/handlers/Message.ts
index 48f87dfe..31ac9108 100644
--- a/api/src/util/handlers/Message.ts
+++ b/api/src/util/handlers/Message.ts
@@ -102,11 +102,11 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
throw new HTTPError("Empty messages are not allowed", 50006);
}
- var content = opts.content;
- var mention_channel_ids = [] as string[];
- var mention_role_ids = [] as string[];
- var mention_user_ids = [] as string[];
- var mention_everyone = false;
+ let content = opts.content;
+ let mention_channel_ids = [] as string[];
+ let mention_role_ids = [] as string[];
+ let mention_user_ids = [] as string[];
+ let mention_everyone = false;
if (content) { // TODO: explicit-only mentions
message.content = content.trim();
@@ -144,7 +144,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
// TODO: cache link result in db
export async function postHandleMessage(message: Message) {
- var links = message.content?.match(LINK_REGEX);
+ let links = message.content?.match(LINK_REGEX);
if (!links) return;
const data = { ...message };
diff --git a/api/src/util/handlers/route.ts b/api/src/util/handlers/route.ts
index 3d3bbc37..eaf7dc91 100644
--- a/api/src/util/handlers/route.ts
+++ b/api/src/util/handlers/route.ts
@@ -87,7 +87,7 @@ const normalizeBody = (body: any = {}) => {
};
export function route(opts: RouteOptions) {
- var validate: AnyValidateFunction<any> | undefined;
+ let validate: AnyValidateFunction<any> | undefined;
if (opts.body) {
validate = ajv.getSchema(opts.body);
if (!validate) throw new Error(`Body schema ${opts.body} not found`);
diff --git a/api/src/util/utility/passwordStrength.ts b/api/src/util/utility/passwordStrength.ts
index 439700d0..f8badea7 100644
--- a/api/src/util/utility/passwordStrength.ts
+++ b/api/src/util/utility/passwordStrength.ts
@@ -19,7 +19,7 @@ const blocklist: string[] = []; // TODO: update ones passwordblocklist is stored
*/
export function checkPassword(password: string): number {
const { minLength, minNumbers, minUpperCase, minSymbols } = Config.get().register.password;
- var strength = 0;
+ let strength = 0;
// checks for total password len
if (password.length >= minLength - 1) {
|