mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
CODEBASE: Fix lint errors 2 (#1756)
This commit is contained in:
@@ -231,16 +231,16 @@ function parseOnlyRamCalculate(
|
||||
prefix: string,
|
||||
obj: object,
|
||||
ref: string,
|
||||
): { func: () => number | number; refDetail: string } | undefined => {
|
||||
): { func: (() => number) | number; refDetail: string } | undefined => {
|
||||
if (!obj) {
|
||||
return;
|
||||
}
|
||||
const elem = Object.entries(obj).find(([key]) => key === ref);
|
||||
if (elem !== undefined && (typeof elem[1] === "function" || typeof elem[1] === "number")) {
|
||||
return { func: elem[1], refDetail: `${prefix}${ref}` };
|
||||
return { func: elem[1] as (() => number) | number, refDetail: `${prefix}${ref}` };
|
||||
}
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
const found = findFunc(`${key}.`, value, ref);
|
||||
const found = findFunc(`${key}.`, value as object, ref);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export class Script implements ContentFile {
|
||||
const ramCalc = calculateRamUsage(this.code, this.filename, this.server, otherScripts);
|
||||
if (ramCalc.cost && ramCalc.cost >= RamCostConstants.Base) {
|
||||
this.ramUsage = roundToTwo(ramCalc.cost);
|
||||
this.ramUsageEntries = ramCalc.entries as RamUsageEntry[];
|
||||
this.ramUsageEntries = ramCalc.entries;
|
||||
this.ramCalculationError = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user