type alias FoundPath

What was at a typed path — one of four things, and never a thrown error.

prefill is the part that does exist, which is what the prompt puts back so the next attempt costs a few keystrokes rather than the whole path again. For a directory that is the path with a slash on it; for a path that goes wrong halfway, the last directory that was real.

Definition

{ kind: "file"; }
| { kind: "directory"; prefill: string; }
| { kind: "missing"; prefill: string; }
| { kind: "unreadable"; detail: string; }

Usage

import { type FoundPath } from "lib/commands/repl/path-argument.ts";