import { readFile } from "node:fs/promises";import { wrapAsync } from "@tsus/runtime/boundary";// readFile is overloaded (string or Buffer); pin the utf8 overload so the// Ok payload is typed as string. The semantic checker caught the old version.const safeRead = wrapAsync((file: string) => readFile(file, "utf8"));const here = new URL("data.txt", import.meta.url).pathname;const nowhere = new URL("missing.txt", import.meta.url).pathname;const found = await safeRead(here);const missing = await safeRead(nowhere);console.log(found.map((text) => text.trim()).unwrapOr("<read failed>"));console.log(missing.map((text) => text.trim()).unwrapOr("<read failed>"));