mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-19 15:54:09 +02:00
Fully remove formatCode function (trim on script save)
This commit is contained in:
+1
-10
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user