f
findPath(): FoundPath
typed: string,
cwd: string
Asks the filesystem what is at a typed path — one of four answers, and never a thrown error.
f
getPathAndDepth(argument: string): { file: string; depth: number; }
The path a command was pointed at, and how deep it was asked to go.
T
FoundPath =
{ kind: "file"; }
| { kind: "directory"; prefill: string; }
| { kind: "missing"; prefill: string; }
| { kind: "unreadable"; detail: string; }
| { kind: "directory"; prefill: string; }
| { kind: "missing"; prefill: string; }
| { kind: "unreadable"; detail: string; }
What was at a typed path — one of four things, and never a thrown error.
Usage
import * as mod from "lib/commands/repl/path-argument.ts";