addPrefixconstconst addPrefix: (prefix: Prefix) => RewritePuts a prefix before every path.
The rules that map the path of a file at the source to its path at the destination, as pure functions with a reason where they cannot: put a prefix before every path, take one off, fold the case, and run one rule after another.
import { addPrefix } from "./rewrite.ts";
// addPrefix("backup") maps "a/b" to "backup/a/b"addPrefixconstconst addPrefix: (prefix: Prefix) => RewritePuts a prefix before every path.
stripPrefixconstconst stripPrefix: (prefix: Prefix) => RewriteTakes a prefix off every path; a path that is not under it cannot be rewritten.
lowerCaseconstconst lowerCase: RewriteFolds every path to lower case.
composeconstconst compose: (...rules: readonly Rewrite[]) => RewriteOne rule after another: the first that cannot make a path is the reason.