fix compile error

This commit is contained in:
Olivier Gagnon 2022-01-26 00:58:02 -05:00
parent d27bac9be6
commit 022dd5d7d7

@ -36,8 +36,8 @@ function initWebserver(): void {
if (home === null) {
return {
res: false,
msg: "Home server does not exist."
}
msg: "Home server does not exist.",
};
}
return {
res: true,
@ -45,11 +45,10 @@ function initWebserver(): void {
files: home.scripts.map((script) => ({
filename: script.filename,
code: script.code,
hash: script.hash(),
ramUsage: script.ramUsage
}))
}
}
ramUsage: script.ramUsage,
})),
},
};
};
(document as any).deleteFile = function (filename: string): IReturnWebStatus {
@ -58,8 +57,8 @@ function initWebserver(): void {
if (home === null) {
return {
res: false,
msg: "Home server does not exist."
}
msg: "Home server does not exist.",
};
}
return home.removeFile(filename);
};
@ -72,10 +71,10 @@ function initWebserver(): void {
if (home === null) {
return {
res: false,
msg: "Home server does not exist."
}
msg: "Home server does not exist.",
};
}
const {success, overwritten} = home.writeToScriptFile(Player, filename, code);
const { success, overwritten } = home.writeToScriptFile(Player, filename, code);
let script;
if (success) {
script = home.getScript(filename);
@ -84,9 +83,8 @@ function initWebserver(): void {
res: success,
data: {
overwritten,
hash: script?.hash() || undefined,
ramUsage: script?.ramUsage
}
ramUsage: script?.ramUsage,
},
};
};
}