Fully remove formatCode function (trim on script save)

This commit is contained in:
omuretsu
2023-05-03 07:21:23 -04:00
parent ad5a1c4bac
commit 3c996a47ea
3 changed files with 3 additions and 14 deletions
+1 -10
View File
@@ -82,7 +82,7 @@ export class Script implements ContentFile {
* @param hostname The server to save the script to
*/
saveScript(filename: ScriptFilePath, code: string, hostname: string): void {
this.code = Script.formatCode(code);
this.code = code;
this.invalidateModule();
this.filename = filename;
this.server = hostname;
@@ -129,15 +129,6 @@ export class Script implements ContentFile {
static fromJSON(value: IReviverValue): Script {
return Generic_fromJSON(Script, value.data, Script.savedKeys);
}
/**
* Formats code: Removes the starting & trailing whitespace
* @param {string} code - The code to format
* @returns The formatted code
*/
static formatCode(code: string): string {
return code.replace(/^\s+|\s+$/g, "");
}
}
constructorsForReviver.Script = Script;