fmt, remove corp routing, lint

This commit is contained in:
Olivier Gagnon
2021-09-06 15:06:08 -04:00
parent 91434b7972
commit 506122f5b8
53 changed files with 1300 additions and 1610 deletions
+2 -4
View File
@@ -125,8 +125,7 @@ async function parseOnlyRamCalculate(otherScripts, code, workerScript) {
// Finally, walk the reference map and generate a ram cost. The initial set of keys to scan
// are those that start with __SPECIAL_INITIAL_MODULE__.
let ram = RamCostConstants.ScriptBaseRamCost;
const unresolvedRefs = Object.keys(dependencyMap).filter((s) =>
s.startsWith(initialModule),
const unresolvedRefs = Object.keys(dependencyMap).filter((s) => s.startsWith(initialModule),
);
const resolvedRefs = new Set();
while (unresolvedRefs.length > 0) {
@@ -148,8 +147,7 @@ async function parseOnlyRamCalculate(otherScripts, code, workerScript) {
if (ref.endsWith(".*")) {
// A prefix reference. We need to find all matching identifiers.
const prefix = ref.slice(0, ref.length - 2);
for (let ident of Object.keys(dependencyMap).filter((k) =>
k.startsWith(prefix),
for (let ident of Object.keys(dependencyMap).filter((k) => k.startsWith(prefix),
)) {
for (let dep of dependencyMap[ident] || []) {
if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);
-21
View File
@@ -1,32 +1,11 @@
import { Script } from "./Script";
import { RamCalculationErrorCode } from "./RamCalculationErrorCodes";
import { calculateRamUsage } from "./RamCalculations";
import { isScriptFilename } from "./ScriptHelpersTS";
import { CONSTANTS } from "../Constants";
import { Engine } from "../engine";
import { parseFconfSettings } from "../Fconf/Fconf";
import {
iTutorialSteps,
iTutorialNextStep,
ITutorial,
} from "../InteractiveTutorial";
import { Player } from "../Player";
import { CursorPositions } from "../ScriptEditor/CursorPositions";
import { AllServers } from "../Server/AllServers";
import { processSingleServerGrowth } from "../Server/ServerHelpers";
import { Settings } from "../Settings/Settings";
import { EditorSetting } from "../Settings/SettingEnums";
import { isValidFilePath } from "../Terminal/DirectoryHelpers";
import { TextFile } from "../TextFile";
import { Page, routing } from "../ui/navigationTracking";
import { numeralWrapper } from "../ui/numeralFormat";
import { dialogBoxCreate } from "../../utils/DialogBox";
import { compareArrays } from "../../utils/helpers/compareArrays";
import { createElement } from "../../utils/uiHelpers/createElement";
export function scriptCalculateOfflineProduction(runningScriptObj) {
//The Player object stores the last update time from when we were online