mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 15:28:43 +02:00
CODEBASE: Fix lint errors 2 (#1756)
This commit is contained in:
@@ -66,7 +66,7 @@ class NSProxyHandler<API extends GenericAPI<API>> {
|
||||
|
||||
const descriptor = Object.getOwnPropertyDescriptor(this.ns, key);
|
||||
if (!descriptor) return descriptor;
|
||||
const field = descriptor.value;
|
||||
const field: unknown = descriptor.value;
|
||||
|
||||
if (typeof field === "function") {
|
||||
const arrayPath = [...this.tree, key];
|
||||
@@ -74,7 +74,7 @@ class NSProxyHandler<API extends GenericAPI<API>> {
|
||||
const ctx = { workerScript: this.ws, function: key, functionPath };
|
||||
// Only do the context-binding once, instead of each time the function
|
||||
// is called.
|
||||
const func: any = field(ctx);
|
||||
const func = field(ctx) as (...args: unknown[]) => unknown;
|
||||
const wrappedFunction = function (...args: unknown[]): unknown {
|
||||
// What remains *must* be called every time.
|
||||
helpers.checkEnvFlags(ctx);
|
||||
|
||||
@@ -692,8 +692,11 @@ function getRunningScript(ctx: NetscriptContext, ident: ScriptIdentifier): Runni
|
||||
return findRunningScriptByPid(ident);
|
||||
} else {
|
||||
const scripts = getRunningScriptsByArgs(ctx, ident.scriptname, ident.hostname, ident.args);
|
||||
if (scripts === null) return null;
|
||||
return scripts.values().next().value ?? null;
|
||||
if (scripts === null) {
|
||||
return null;
|
||||
}
|
||||
const next = scripts.values().next();
|
||||
return !next.done ? next.value : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user