This commit is contained in:
Louis Lam
2023-12-25 18:02:46 +08:00
parent 0c32171acc
commit 17f9ee63f7
13 changed files with 137 additions and 76 deletions

View File

@@ -74,6 +74,14 @@ export function callbackError(error : unknown, callback : unknown) {
}
}
export function callbackResult(result : unknown, callback : unknown) {
if (typeof(callback) !== "function") {
log.error("console", "Callback is not a function");
return;
}
callback(result);
}
export async function doubleCheckPassword(socket : DockgeSocket, currentPassword : unknown) {
if (typeof currentPassword !== "string") {
throw new Error("Wrong data type?");