versions.filesOffunctionno test imports itfunction filesOf(tracked: readonly string[], folder: string, folders: readonly string[], exclude: readonly string[], extra?: readonly string[]): readonly string[]The paths of a work among tracked paths.
Which files are a work's (commons 0026-works-versioning FR-009): a work is a folder that holds a release.ts; its files are every file Git tracks under the folder except those of a work nested in it, its own release.ts and CITATION.cff, and the paths its record names in exclude, and, besides, every tracked file under the paths its record names in paths (folders or files outside its folder, from the root of the repository: FR-039). Every judgement of a version is scoped to those files and to no others (path-scoped).
Pure: it works on lists of paths (as git ls-files or git ls-tree gives them, with /), so the same code scopes a tree at the head and at the base. A path is a work's by its place alone, so a file that was deleted is still told as the work's it was. A work of a repository of one work keeps its record at the root, and its folder is "".
import { scopeOf, workFolders } from "./works.ts";
const folders = workFolders(["a/release.ts", "a/x.ts", "a/b/release.ts", "a/b/y.ts"]); // ["a", "a/b"]
scopeOf("a", folders, [])("a/b/y.ts"); // false: it is a nested work'sversions.filesOffunctionno test imports itfunction filesOf(tracked: readonly string[], folder: string, folders: readonly string[], exclude: readonly string[], extra?: readonly string[]): readonly string[]The paths of a work among tracked paths.
versions.folderOffunctionno test imports itfunction folderOf(path: string): stringThe folder a path is in: everything before its last /, "" for a file at the root.
versions.isUnderfunctionno test imports itfunction isUnder(path: string, under: string): booleanWhether path is under or inside it ("" holds everything).
versions.recordPathOffunctionno test imports itfunction recordPathOf(folder: string): stringThe path of the record of the work in a folder.
versions.scopeOffunctionno test imports itfunction scopeOf(folder: string, folders: readonly string[], exclude: readonly string[], paths?: readonly string[]): (path: string) => booleanWhether a path is a file of the work in folder (FR-009, FR-039): under the folder, not under another work's folder nested in it, not its release.ts or CITATION.cff, and not under a path of exclude (paths of the folder); or, whatever the folder, under one of paths (paths of the repository that the record adds to the work's files), its own two files apart.
versions.workFoldersfunctionno test imports itfunction workFolders(paths: readonly string[]): readonly string[]The folders that hold a release.ts among tracked paths, in order.
filesOffunctionfunction filesOf(tracked: readonly string[], folder: string, folders: readonly string[], exclude: readonly string[], extra?: readonly string[]): readonly string[]The paths of a work among tracked paths.
folderOffunctionno test imports itfunction folderOf(path: string): stringThe folder a path is in: everything before its last /, "" for a file at the root.
isUnderfunctionno test imports itfunction isUnder(path: string, under: string): booleanWhether path is under or inside it ("" holds everything).
recordPathOffunctionno test imports itfunction recordPathOf(folder: string): stringThe path of the record of the work in a folder.
scopeOffunctionfunction scopeOf(folder: string, folders: readonly string[], exclude: readonly string[], paths?: readonly string[]): (path: string) => booleanWhether a path is a file of the work in folder (FR-009, FR-039): under the folder, not under another work's folder nested in it, not its release.ts or CITATION.cff, and not under a path of exclude (paths of the folder); or, whatever the folder, under one of paths (paths of the repository that the record adds to the work's files), its own two files apart.
workFoldersfunctionfunction workFolders(paths: readonly string[]): readonly string[]The folders that hold a release.ts among tracked paths, in order.