IF Commons GitHub

physical/store

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-objective-evidence FR-007

The store of records on disk (0002-objective-evidence FR-007): the records of a folder read in the order of their paths, with a problem for each file that is not a valid record, and a record written to its place without replacing one that is there (evidence is added, never changed).

import { readStore } from "./store.ts";
(await readStore("/nonexistent")).records.length; // 0

Source: commons/assessment/src/physical/store.ts

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

physical.Storetypeno test imports it
type Store = { readonly records: readonly Evidence[]; readonly problems: readonly string[] };

What a folder holds: its valid records and what is wrong with the files that are not.

physical.readStorefunctionno test imports it
function readStore(dir: string): Promise<Store>

The records under a folder.

physical.addRecordfunctionno test imports it
function addRecord(dir: string, e: Evidence): Promise<{ readonly kind: "ok"; readonly path: string; } | { readonly kind: "err"; readonly error: string; }>

Writes a record to its place under a folder; where a file is there already it refuses, naming the path.

Storetypeno test imports it
type Store = { readonly records: readonly Evidence[]; readonly problems: readonly string[] };

What a folder holds: its valid records and what is wrong with the files that are not.

readStorefunction
function readStore(dir: string): Promise<Store>

The records under a folder.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

addRecordfunction
function addRecord(dir: string, e: Evidence): Promise<{ readonly kind: "ok"; readonly path: string; } | { readonly kind: "err"; readonly error: string; }>

Writes a record to its place under a folder; where a file is there already it refuses, naming the path.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

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