diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 903f65400..7599e4fc8 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -75,7 +75,7 @@ interface Player { /** * @public */ - export interface Multipliers { +export interface Multipliers { /** Multiplier to hacking skill */ hacking?: number; /** Multiplier to strength skill */ diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index 2ec374304..48ebc7677 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -803,7 +803,9 @@ export function Root(props: IProps): React.ReactElement { ...colorProps, }; - const scriptTabText = `${hostname}:~${fileName.startsWith("/") ? "" : "/"}${fileName} ${dirty(index)}`; + const scriptTabText = `${hostname}:~${fileName.startsWith("/") ? "" : "/"}${fileName} ${dirty( + index, + )}`; return ( { - try{ + try { return prev[curr]; - } - catch{ + } catch { throw new Error(`Invalid function: [${fnDesc}]`); } }, scope as any); @@ -143,14 +140,13 @@ describe("Netscript Dynamic RAM Calculation/Generation Tests", function () { scriptRef: runningScript, }; workerScript.env.vars = NetscriptFunctions(workerScript as unknown as WorkerScript); - + // Run the function through the workerscript's args const scope = workerScript.env.vars; let curr = fnDesc.reduce((prev, curr) => { - try{ + try { return prev[curr]; - } - catch{ + } catch { throw new Error(`Invalid function: [${fnDesc}]`); } }, scope as any); diff --git a/test/jest/Terminal/Directory.test.ts b/test/jest/Terminal/Directory.test.ts index 095c80024..c421ac66a 100644 --- a/test/jest/Terminal/Directory.test.ts +++ b/test/jest/Terminal/Directory.test.ts @@ -283,8 +283,8 @@ describe("Terminal Directory Tests", function () { }); it("should return false for invalid inputs (inputs that aren't filepaths)", function () { - expect(isInRootDirectory(null as unknown as string)).toEqual(false); - expect(isInRootDirectory(undefined as unknown as string)).toEqual(false); + expect(isInRootDirectory(null as unknown as string)).toEqual(false); + expect(isInRootDirectory(undefined as unknown as string)).toEqual(false); expect(isInRootDirectory("")).toEqual(false); expect(isInRootDirectory(" ")).toEqual(false); expect(isInRootDirectory("a")).toEqual(false); diff --git a/test/jest/ui/nFormat.test.ts b/test/jest/ui/nFormat.test.ts index f88a654fe..e07a6254d 100644 --- a/test/jest/ui/nFormat.test.ts +++ b/test/jest/ui/nFormat.test.ts @@ -241,6 +241,8 @@ describe("Finding the number furthest away from 0", () => { expect(numeralWrapper.largestAbsoluteNumber(789123, -123456, -456789)).toEqual(789123); }); test("Should return 0 for invalid input", () => { - expect(numeralWrapper.largestAbsoluteNumber("abc" as unknown as number, undefined, null as unknown as number)).toEqual(0); + expect( + numeralWrapper.largestAbsoluteNumber("abc" as unknown as number, undefined, null as unknown as number), + ).toEqual(0); }); });