mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-06 07:37:56 +02:00
CODEBASE: Fix lint errors 3 (#1758)
This is a really big refactor because it actually *fixes* a lot of the lint errors instead of disabling them.
This commit is contained in:
@@ -4,6 +4,7 @@ import { codingContractTypesMetadata } from "./data/codingcontracttypes";
|
||||
import { Generic_fromJSON, Generic_toJSON, IReviverValue, constructorsForReviver } from "./utils/JSONReviver";
|
||||
import { CodingContractEvent } from "./ui/React/CodingContractModal";
|
||||
import { ContractFilePath, resolveContractFilePath } from "./Paths/ContractFilePath";
|
||||
import { objectAssert } from "./utils/helpers/typeAssertion";
|
||||
|
||||
/* Contract Types */
|
||||
export const CodingContractTypes = Object.fromEntries(codingContractTypesMetadata.map((x) => [x.name, x]));
|
||||
@@ -127,6 +128,7 @@ export class CodingContract {
|
||||
|
||||
/** Initializes a CodingContract from a JSON save state. */
|
||||
static fromJSON(value: IReviverValue): CodingContract {
|
||||
objectAssert(value.data);
|
||||
// In previous versions, there was a data field instead of a state field.
|
||||
if ("data" in value.data) {
|
||||
value.data.state = value.data.data;
|
||||
|
||||
Reference in New Issue
Block a user