Prettier
This commit is contained in:
parent
2a7051bdc8
commit
126a881f31
@ -4,3 +4,5 @@ node_modules
|
|||||||
.github
|
.github
|
||||||
.vscode
|
.vscode
|
||||||
hashes.json
|
hashes.json
|
||||||
|
flake.lock
|
||||||
|
extra/admin-api
|
@ -21,10 +21,10 @@ We aim to reverse engineer and add additional features to the Discord backend, w
|
|||||||
|
|
||||||
This repository contains:
|
This repository contains:
|
||||||
|
|
||||||
- [Spacebar HTTP API Server](/src/api)
|
- [Spacebar HTTP API Server](/src/api)
|
||||||
- [WebSocket Gateway Server](/src/gateway)
|
- [WebSocket Gateway Server](/src/gateway)
|
||||||
- [HTTP CDN Server](/src/cdn)
|
- [HTTP CDN Server](/src/cdn)
|
||||||
- [Utility and Database Models](/src/util)
|
- [Utility and Database Models](/src/util)
|
||||||
|
|
||||||
## [Documentation](https://docs.spacebar.chat)
|
## [Documentation](https://docs.spacebar.chat)
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ declare global {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class SpacebarServer extends Server {
|
export class SpacebarServer extends Server {
|
||||||
public declare options: SpacebarServerOptions;
|
declare public options: SpacebarServerOptions;
|
||||||
|
|
||||||
constructor(opts?: Partial<SpacebarServerOptions>) {
|
constructor(opts?: Partial<SpacebarServerOptions>) {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
@ -157,11 +157,13 @@ export async function ImageProxy(req: Request, res: Response) {
|
|||||||
|
|
||||||
const buffer = Buffer.from(arrayBuffer);
|
const buffer = Buffer.from(arrayBuffer);
|
||||||
if (sharp && sharpSupported.has(contentType)) {
|
if (sharp && sharpSupported.has(contentType)) {
|
||||||
resultBuffer = Buffer.from(await sharp
|
resultBuffer = Buffer.from(
|
||||||
.default(buffer)
|
await sharp
|
||||||
// Sharp doesn't support "scaleToFit"
|
.default(buffer)
|
||||||
.resize(width)
|
// Sharp doesn't support "scaleToFit"
|
||||||
.toBuffer());
|
.resize(width)
|
||||||
|
.toBuffer(),
|
||||||
|
);
|
||||||
} else if (Jimp && jimpSupported.has(contentType)) {
|
} else if (Jimp && jimpSupported.has(contentType)) {
|
||||||
resultBuffer = await Jimp.read(buffer).then((image) => {
|
resultBuffer = await Jimp.read(buffer).then((image) => {
|
||||||
contentType = image.getMIME();
|
contentType = image.getMIME();
|
||||||
@ -183,5 +185,3 @@ export async function ImageProxy(req: Request, res: Response) {
|
|||||||
|
|
||||||
res.send(resultBuffer);
|
res.send(resultBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,9 @@ router.post(
|
|||||||
|
|
||||||
let user;
|
let user;
|
||||||
try {
|
try {
|
||||||
const userTokenData = await checkToken(token, {select : ["email"]});
|
const userTokenData = await checkToken(token, {
|
||||||
|
select: ["email"],
|
||||||
|
});
|
||||||
user = userTokenData.user;
|
user = userTokenData.user;
|
||||||
} catch {
|
} catch {
|
||||||
throw FieldErrors({
|
throw FieldErrors({
|
||||||
|
@ -28,7 +28,7 @@ import { BodyParser } from "../api/middlewares/BodyParser";
|
|||||||
export type CDNServerOptions = ServerOptions;
|
export type CDNServerOptions = ServerOptions;
|
||||||
|
|
||||||
export class CDNServer extends Server {
|
export class CDNServer extends Server {
|
||||||
public declare options: CDNServerOptions;
|
declare public options: CDNServerOptions;
|
||||||
|
|
||||||
constructor(options?: Partial<CDNServerOptions>) {
|
constructor(options?: Partial<CDNServerOptions>) {
|
||||||
super(options);
|
super(options);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user