import type { ConnectInstancePayload, ImportInstancePayload, } from "@/types/instance"; /** * Discriminate the two branches of the connect form's submit payload. * * A payload is an `ImportInstancePayload` iff it carries a non-empty * `token` string. The onboarding page and the connect dialog used to each * inline an identical copy of this guard; centralising it here removes * the drift risk the second CR round flagged (N-M10) and gives tests a * single seam to exercise. */ export function isImportPayload( value: ConnectInstancePayload | ImportInstancePayload, ): value is ImportInstancePayload { return typeof (value as ImportInstancePayload).token === "string"; }