mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 08:13:50 +02:00
run auto fix lint
This commit is contained in:
+10
-10
@@ -12,7 +12,7 @@ import { setTimeoutRef } from "../utils/SetTimeoutRef";
|
||||
import {
|
||||
Generic_fromJSON,
|
||||
Generic_toJSON,
|
||||
Reviver
|
||||
Reviver,
|
||||
} from "../../utils/JSONReviver";
|
||||
import { roundToTwo } from "../../utils/helpers/roundToTwo";
|
||||
|
||||
@@ -25,13 +25,13 @@ export class Script {
|
||||
}
|
||||
|
||||
// Code for this script
|
||||
code: string = "";
|
||||
code = "";
|
||||
|
||||
// Filename for the script file
|
||||
filename: string = "";
|
||||
filename = "";
|
||||
|
||||
// url of the script if any, only for NS2.
|
||||
url: string = "";
|
||||
url = "";
|
||||
|
||||
// The dynamic module generated for this script when it is run.
|
||||
// This is only applicable for NetscriptJS
|
||||
@@ -46,12 +46,12 @@ export class Script {
|
||||
dependencies: ScriptUrl[] = [];
|
||||
|
||||
// Amount of RAM this Script requres to run
|
||||
ramUsage: number = 0;
|
||||
ramUsage = 0;
|
||||
|
||||
// IP of server that this script is on.
|
||||
server: string = "";
|
||||
server = "";
|
||||
|
||||
constructor(fn: string="", code: string="", server: string="", otherScripts: Script[]=[]) {
|
||||
constructor(fn="", code="", server="", otherScripts: Script[]=[]) {
|
||||
this.filename = fn;
|
||||
this.code = code;
|
||||
this.ramUsage = 0;
|
||||
@@ -59,7 +59,7 @@ export class Script {
|
||||
this.module = "";
|
||||
this.moduleSequenceNumber = ++globalModuleSequenceNumber;
|
||||
if (this.code !== "") { this.updateRamUsage(otherScripts); }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the script as a file
|
||||
@@ -70,7 +70,7 @@ export class Script {
|
||||
if (window.navigator.msSaveOrOpenBlob) {// IE10+
|
||||
window.navigator.msSaveOrOpenBlob(file, filename);
|
||||
} else { // Others
|
||||
var a = document.createElement("a"),
|
||||
const a = document.createElement("a"),
|
||||
url = URL.createObjectURL(file);
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
@@ -119,7 +119,7 @@ export class Script {
|
||||
* @param {Script[]} otherScripts - Other scripts on the server. Used to process imports
|
||||
*/
|
||||
async updateRamUsage(otherScripts: Script[]) {
|
||||
var res = await calculateRamUsage(this.code, otherScripts);
|
||||
const res = await calculateRamUsage(this.code, otherScripts);
|
||||
if (res > 0) {
|
||||
this.ramUsage = roundToTwo(res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user