IF Commons GitHub

logical/derive

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

Directories, derived: a store has objects and no directories, so a directory exists where an object lies below it, and its names are the first segments of the paths below it. A name that is an object and also the first segment of other paths is shown as a file and the other paths are noticed. The marker objects of a policy that keeps empty directories keep a directory but are not names in it.

import { childrenOf } from "./derive.ts";
// childrenOf(prefix, stats, policy): the names below a prefix, in order, whether the directory exists, and what was noticed

Source: commons/anyfs-posix/src/logical/derive.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.

logical.Childrentypeno test imports it
type Children = {
  /** Whether the directory exists: an object lies below it, a marker included. */
  readonly exists: boolean;
  /** The names, in the order of their code points. */
  readonly entries: readonly DirEntry[];
  /** What was noticed. */
  readonly notes: readonly string[];
};

What a directory holds.

logical.isMarkerfunctionno test imports it
function isMarker(policy: Policy, path: Path): boolean

Whether a path is a marker object of the policy: an object of the marker's name, at any depth.

logical.childrenOffunctionno test imports it
function childrenOf(dir: Prefix, below: readonly Stat[], policy: Policy): Children

The names below a prefix, from the objects below it (all of them: a list of the prefix, in any order).

Childrentypeno test imports it
type Children = {
  /** Whether the directory exists: an object lies below it, a marker included. */
  readonly exists: boolean;
  /** The names, in the order of their code points. */
  readonly entries: readonly DirEntry[];
  /** What was noticed. */
  readonly notes: readonly string[];
};

What a directory holds.

isMarkerfunction
function isMarker(policy: Policy, path: Path): boolean

Whether a path is a marker object of the policy: an object of the marker's name, at any depth.

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

childrenOffunction
function childrenOf(dir: Prefix, below: readonly Stat[], policy: Policy): Children

The names below a prefix, from the objects below it (all of them: a list of the prefix, in any order).

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

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