diff --git a/src/api/routes/guild-recommendations.ts b/src/api/routes/guild-recommendations.ts index dcd512e..fa642ea 100644 --- a/src/api/routes/guild-recommendations.ts +++ b/src/api/routes/guild-recommendations.ts @@ -38,10 +38,7 @@ const { limit } = req.query; const showAllGuilds = Config.get().guild.discovery.showAllGuilds; - const genLoadId = (size: number) => - [...Array(size)] - .map(() => Math.floor(Math.random() * 16).toString(16)) - .join(""); + const genLoadId = (size: number) => [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join(""); const guilds = showAllGuilds ? await Guild.find({ take: Math.abs(Number(limit || 24)) }) diff --git "a/src/api/routes/guilds/\043guild_id/members/\043member_id/nick.ts" "b/src/api/routes/guilds/\043guild_id/members/\043member_id/nick.ts" index 5c72429..2a70777 100644 --- "a/src/api/routes/guilds/\043guild_id/members/\043member_id/nick.ts" +++ "b/src/api/routes/guilds/\043guild_id/members/\043member_id/nick.ts" @@ -41,10 +41,7 @@ async (req: Request, res: Response) => { const { guild_id } = req.params; let permissionString: PermissionResolvable = "MANAGE_NICKNAMES"; - const member_id = - req.params.member_id === "@me" - ? ((permissionString = "CHANGE_NICKNAME"), req.user_id) - : req.params.member_id; + const member_id = req.params.member_id === "@me" ? ((permissionString = "CHANGE_NICKNAME"), req.user_id) : req.params.member_id; const perms = await getPermission(req.user_id, guild_id); perms.hasThrow(permissionString); diff --git a/src/api/routes/hub-waitlist.ts b/src/api/routes/hub-waitlist.ts index 2d21ad6..bdf0931 100644 --- a/src/api/routes/hub-waitlist.ts +++ b/src/api/routes/hub-waitlist.ts @@ -17,10 +17,7 @@ */ import { route } from "@spacebar/api"; -import { - HubWaitlistSignupResponse, - HubWaitlistSignupSchema, -} from "@spacebar/schemas"; +import { HubWaitlistSignupResponse, HubWaitlistSignupSchema } from "@spacebar/schemas"; import { Request, Response, Router } from "express"; const router = Router({ mergeParams: true }); diff --git a/src/api/routes/users/@me/disable.ts b/src/api/routes/users/@me/disable.ts index 07e0605..73de839 100644 --- a/src/api/routes/users/@me/disable.ts +++ b/src/api/routes/users/@me/disable.ts @@ -45,10 +45,7 @@ if (user.data.hash) { // guest accounts can delete accounts without password - correctpass = await bcrypt.compare( - req.body.password, - user.data.hash, - ); //Not sure if user typed right password :/ + correctpass = await bcrypt.compare(req.body.password, user.data.hash); //Not sure if user typed right password :/ } if (correctpass) { diff --git a/src/api/routes/users/@me/notes.ts b/src/api/routes/users/@me/notes.ts index e468c36..4969fa7 100644 --- a/src/api/routes/users/@me/notes.ts +++ b/src/api/routes/users/@me/notes.ts @@ -79,10 +79,7 @@ }, }) ) { - Note.update( - { owner: { id: owner.id }, target: { id: target.id } }, - { owner, target, content: note }, - ); + Note.update({ owner: { id: owner.id }, target: { id: target.id } }, { owner, target, content: note }); } else { Note.insert({ id: Snowflake.generate(), diff --git a/src/api/util/utility/captcha.ts b/src/api/util/utility/captcha.ts index 3f654a4..f6d4d0e 100644 --- a/src/api/util/utility/captcha.ts +++ b/src/api/util/utility/captcha.ts @@ -46,10 +46,7 @@ const { security } = Config.get(); const { service, secret, sitekey } = security.captcha; - if (!service || !secret || !sitekey) - throw new Error( - "CAPTCHA is not configured correctly. https://docs.spacebar.chat/setup/server/security/captcha/", - ); + if (!service || !secret || !sitekey) throw new Error("CAPTCHA is not configured correctly. https://docs.spacebar.chat/setup/server/security/captcha/"); const res = await fetch(verifyEndpoints[service], { method: "POST", diff --git a/src/util/util/lambert-server/HTTPError.ts b/src/util/util/lambert-server/HTTPError.ts index 70ba92a..2302630 100644 --- a/src/util/util/lambert-server/HTTPError.ts +++ b/src/util/util/lambert-server/HTTPError.ts @@ -1,5 +1,8 @@ export class HTTPError extends Error { - constructor(message: string, public code: number = 400) { + constructor( + message: string, + public code: number = 400, + ) { super(message); } } diff --git a/src/util/util/lambert-server/Utils.ts b/src/util/util/lambert-server/Utils.ts index 23766fd..0785e85 100644 --- a/src/util/util/lambert-server/Utils.ts +++ b/src/util/util/lambert-server/Utils.ts @@ -10,10 +10,7 @@ const DEFAULT_EXCLUDE_DIR = /^\./; const DEFAULT_FILTER = /^([^.].*)(?( - options: traverseDirectoryOptions, - action: (path: string) => T -): Promise { +export async function traverseDirectory(options: traverseDirectoryOptions, action: (path: string) => T): Promise { if (!options.filter) options.filter = DEFAULT_FILTER; if (!options.excludeDirs) options.excludeDirs = DEFAULT_EXCLUDE_DIR; diff --git a/src/webrtc/opcodes/BackendVersion.ts b/src/webrtc/opcodes/BackendVersion.ts index c97f4b4..556e55f 100644 --- a/src/webrtc/opcodes/BackendVersion.ts +++ b/src/webrtc/opcodes/BackendVersion.ts @@ -18,10 +18,7 @@ import { VoiceOPCodes, VoicePayload, WebRtcWebSocket, Send } from "../util"; -export async function onBackendVersion( - this: WebRtcWebSocket, - data: VoicePayload, -) { +export async function onBackendVersion(this: WebRtcWebSocket, data: VoicePayload) { await Send(this, { op: VoiceOPCodes.VOICE_BACKEND_VERSION, d: { voice: "0.8.43", rtc_worker: "0.3.26" }, diff --git a/src/webrtc/opcodes/index.ts b/src/webrtc/opcodes/index.ts index da561f8..2a79b8f 100644 --- a/src/webrtc/opcodes/index.ts +++ b/src/webrtc/opcodes/index.ts @@ -24,10 +24,7 @@ import { onSpeaking } from "./Speaking"; import { onVideo } from "./Video"; -export type OPCodeHandler = ( - this: WebRtcWebSocket, - data: VoicePayload, -) => Promise; +export type OPCodeHandler = (this: WebRtcWebSocket, data: VoicePayload) => Promise; export default { [VoiceOPCodes.HEARTBEAT]: onHeartbeat,