RequirementTexttypeno test imports ittype RequirementText = (requirement: string) => string | undefined;A lookup of the text of a requirement by its name (NNNN-slug FR-nnn), or none where the specifications do not state it.
The text of a requirement as the specifications state it at a revision (commons 0001-quality-evidence FR-068): the Assessor and Internal pages show it beside a nonconformance, and the Public page never does. requirementTextOf is the pure lookup, made from the text of the specifications it is given; readRequirementTexts reads them from Git at the tested revision, so the page says what the requirement said when it was tested, not what it says now.
A requirement is named NNNN-slug FR-nnn: the folder of its specification and its number. A requirement is a bullet - **FR-nnn**: text, and the lines that continue it (indented) belong to it. Its text is returned as one line.
import { requirementTextOf } from "./requirement-text.ts";
const text = requirementTextOf(new Map([["0099-demo", "- **FR-052**: The first requirement.\n"]]));
text("0099-demo FR-001"); // "The first requirement."RequirementTexttypeno test imports ittype RequirementText = (requirement: string) => string | undefined;A lookup of the text of a requirement by its name (NNNN-slug FR-nnn), or none where the specifications do not state it.
requirementTextOffunctionfunction requirementTextOf(specs: ReadonlyMap<string, string>): RequirementTextThe lookup made from the text of specifications, by the name of the folder of each (0021-ifqs).
NO_REQUIREMENT_TEXTconstconst NO_REQUIREMENT_TEXT: RequirementTextThe lookup that knows no requirement: the page of a harness that gives no specifications shows none.
readRequirementTextsfunctionfunction readRequirementTexts(repo: string, revision: string): Promise<Result<RequirementText, string>>The text of the specifications of a revision of the repository, read with git, as a lookup (the revision is the tested one).