summary refs log tree commit diff
path: root/api/src/util
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-07-18 18:30:53 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-09 23:28:27 +0200
commite536fb2f72e4883979b451b60b12c44f5f94313c (patch)
tree9c7fccb12c5aeec560d3c223a3b6e969e8d95cd9 /api/src/util
parentUpdate User.ts (diff)
downloadserver-e536fb2f72e4883979b451b60b12c44f5f94313c.tar.xz
replace all var with let (reduces warnings)
Diffstat (limited to 'api/src/util')
-rw-r--r--api/src/util/handlers/Message.ts12
-rw-r--r--api/src/util/handlers/route.ts2
-rw-r--r--api/src/util/utility/passwordStrength.ts2
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) {