Functions

f
formatPathDisplay(
file: string,
projectRoot: string
): string

A path as a person would say it: qunitx-cli/lib/repl/session.ts for something in this project, and the absolute path for anything outside it.

f
opening(name: string): ReplCommand["main"]

.open, .edit and .e — whichever editor the environment prefers.

f
openingIn(editor: string): ReplCommand["main"]

What .open and every editor-named spelling of it do, differing only in which editor they mean.

f
pausePrompt(server: REPLServer): void

Stops the prompt reading, because what happens next is not the prompt's.

f
readIfThere(file: string): string | null

A file's contents, or null when it cannot be read — a missing path is an answer, not a crash.

f
replayableSource(lines: readonly string[]): string

The lines of a session worth replaying: everything typed, minus the shell escapes.

f
resumePrompt(server: REPLServer): void

Gives the prompt back its input — unless the session has gone.

f
userMeansYes(answer: string): boolean

How an answer to [Y/n] is read: Enter, or anything starting with y. Everything else is no.

f
whatToRun(edited: { text: string; saved: boolean; aborted: boolean; }): string

What an edit leaves to run: the buffer where it moved, and nothing where it did not.

f
writeIfPossible(
file: string,
contents: string
): boolean

True when the file was written. A save that cannot land is a message, not a crashed session.