Appearance
@loontail/minecraft-kit / verifyAndRepair
Function: verifyAndRepair()
ts
function verifyAndRepair(deps, input): Promise<VerifyAndRepairResult>;Defined in: src/repair/verify-and-repair.ts:57
Verify a single aspect and, in 'fix' mode (default), repair every broken file before returning. In 'report' mode the function never touches disk — it returns the verification only and leaves repair as null.
The helper is a thin orchestrator on top of the existing per-aspect verifiers and repair planners. It exists so consumers do not have to wire three calls (verify → plan → run) by hand for the common "find and fix this aspect" case.
Prefer kit.repair.verifyAndRepair({ aspect, target }) over importing this directly.
Parameters
| Parameter | Type |
|---|---|
deps | VerifyAndRepairDeps |
input | VerifyAndRepairInput |
Returns
Promise<VerifyAndRepairResult>
Example
ts
import { MinecraftKit, RepairModes } from "@loontail/minecraft-kit";
const kit = new MinecraftKit();
const { verification, repair } = await kit.repair.verifyAndRepair({
aspect: "minecraft",
target,
});
if (repair !== null) console.log(`repaired ${repair.actionsCompleted} files`);
const diagnosis = await kit.repair.verifyAndRepair({
aspect: "runtime",
target,
mode: RepairModes.REPORT,
});
if (!diagnosis.verification.isValid) console.warn("runtime broken, ask user to repair");