fileName
A file's name on disk: its name in the codebase, and its format as the extension (none for a file without one,
like Dockerfile), after a dot for a hidden file (.gitignore, .mcp.json).
import { formatOf } from "#codebase/tcmts/cli/files"; import type { DefRecord } from "#codebase/tcmts/core/types"; export const fileName = (leaf: string, rec: DefRecord): string => `${(JSON.parse(rec.ir) as string[])[1]!.startsWith(".") ? "." : ""}${leaf}${formatOf(rec) ? `.${formatOf(rec)}` : ""}`