CODEBASE: Merge TypeAssertion files (#1922)

This commit is contained in:
catloversg
2025-01-25 02:06:39 +07:00
committed by GitHub
parent f0a0d3095e
commit 9bf408221c
19 changed files with 125 additions and 111 deletions
+3 -3
View File
@@ -15,7 +15,7 @@ import { currentNodeMults } from "../BitNode/BitNodeMultipliers";
import { helpers } from "../Netscript/NetscriptHelpers";
import { getEnumHelper } from "../utils/EnumHelper";
import { Skills } from "../Bladeburner/data/Skills";
import { assertString } from "../Netscript/TypeAssertion";
import { assertStringWithNSContext } from "../Netscript/TypeAssertion";
import { BlackOperations, blackOpsArray } from "../Bladeburner/data/BlackOperations";
import { checkSleeveAPIAccess, checkSleeveNumber } from "../NetscriptFunctions/Sleeve";
import { canAccessBitNodeFeature } from "../BitNode/BitNodeUtils";
@@ -37,8 +37,8 @@ export function NetscriptBladeburner(): InternalAPI<INetscriptBladeburner> {
};
function getAction(ctx: NetscriptContext, type: unknown, name: unknown): Action {
const bladeburner = Player.bladeburner;
assertString(ctx, "type", type);
assertString(ctx, "name", name);
assertStringWithNSContext(ctx, "type", type);
assertStringWithNSContext(ctx, "name", name);
if (bladeburner === null) throw new Error("Must have joined bladeburner");
const action = bladeburner.getActionFromTypeAndName(type, name);
if (!action) throw helpers.errorMessage(ctx, `Invalid action type='${type}', name='${name}'`);