IF Commons GitHub

logical/stores

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-anyfs-cli-logical FR-004

The capabilities a verb needs of a store, asked at run time (commons anyfs-cli 0003-anyfs-cli-logical FR-004): an opener gives a store whose capabilities are known only when it is open, so each verb asks for the capabilities it uses and ends with a sentence that names what is missing where the store has none of them. The casts are here and only here, each after the check of the set of capabilities that the type promises.

import { viewable } from "./stores.ts";
// const store = viewable(opened); store === undefined ? "cannot be listed" : "ok";

Source: commons/anyfs-cli/src/logical/stores.ts

6 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.

viewablefunction
function viewable(store: StoreBase): Store<"list" | "read" | "stat"> | undefined

The store as something that can be read: read, list and stat.

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

sourceOffunction
function sourceOf(store: StoreBase): Store<"list" | "read" | "stat"> | undefined

The store as the source of a transfer.

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

movableOffunction
function movableOf(store: StoreBase): Store<"delete" | "list" | "read" | "stat"> | undefined

The store as the source of a move: it can also delete.

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

destOffunction
function destOf(store: StoreBase): Store<"delete" | "list" | "read" | "stat" | "write"> | undefined

The store as the destination of a transfer: it can be read, written, listed, and have objects deleted.

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

capabilityNamesfunction
function capabilityNames(store: StoreBase): readonly ("append" | "batch" | "cas" | "delete" | "history" | "list" | "lock" | "merge" | "rangeRead" | "read" | "rename" | "search" | "stat" | "watch" | "write")[]

The names of the capabilities of a store that a person would want to see, in a fixed order.

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

missingfunction
function missing(store: StoreBase, needed: readonly ("append" | "batch" | "cas" | "delete" | "history" | "list" | "lock" | "merge" | "rangeRead" | "read" | "rename" | "search" | "stat" | "watch" | "write")[]): readonly ("append" | "batch" | "cas" | "delete" | "history" | "list" | "lock" | "merge" | "rangeRead" | "read" | "rename" | "search" | "stat" | "watch" | "write")[]

The capabilities of needed that a store lacks.

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

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