Refactor to mono-repo + upgrade packages

This commit is contained in:
Madeline
2022-09-25 23:35:18 +10:00
parent 59d94b4894
commit f44f5d7ac2
583 changed files with 5415 additions and 114015 deletions
+18
View File
@@ -0,0 +1,18 @@
import { instanceOf } from "lambert-server";
import { WebSocket } from "@fosscord/gateway";
import { CLOSECODES } from "../util/Constants";
export function check(this: WebSocket, schema: any, data: any) {
try {
const error = instanceOf(schema, data, { path: "body" });
if (error !== true) {
throw error;
}
return true;
} catch (error) {
console.error(error);
// invalid payload
this.close(CLOSECODES.Decode_error);
throw error;
}
}