IF Commons GitHub

logical/remap

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-anyfs-logical FR-004, 0003-anyfs-logical FR-005

The paths of an operation and of what it ended with, changed by a function. sub and a mount are the same thing seen from two sides: one adds a prefix to the paths a program names and takes it off what comes back, the other takes it off and puts it back. Both are written once, here, over every operation, so that none of them forgets a path (a rename has two, a batch has many, a list answers with many).

Source: commons/anyfs/src/logical/remap.ts

0 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

PathMaptypeno test imports it
type PathMap = { readonly path: (path: Path) => Result<Path, Problem>; readonly prefix: (prefix: Prefix) => Result<Prefix, Problem> };

How the paths of one side become the paths of the other: of a path, and of a prefix.

mapOpfunctionno test imports it
function mapOp(map: PathMap, op: Op): Result<Op, Problem>

An operation with its paths changed, or the problem of the first path that cannot be.

mapDonefunctionno test imports it
function mapDone(map: PathMap, done: Done): Result<Done, Problem>

What an operation ended with, with its paths changed.

mapProblemfunctionno test imports it
function mapProblem(change: (path: Path) => Path, problem: Problem): Problem

A problem with the path it names changed, by a function that cannot fail (a path that cannot be changed stays as it is).

Titles, headings, exports, tables, columns and requirements. Esc closes.