IF Commons GitHub

governance/codelist

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-governance FR-001

A code list (commons data 0003-governance FR-001): the controlled vocabulary of a domain, a set of codes each with a label and, where the label is not enough, a definition. The names of its codes are literal types.

Source: commons/data/governance/codelist.ts

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

AnyCodeListtype
type AnyCodeList = CodeList<string, string>;

A code list of any name and codes.

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

CodeListinterfaceno test imports it
interface CodeList<N extends string = string, K extends string = string>

A code list.

MemberTypeWhat it is
kind"codelist"
nameN
definitionstring
codesReadonly<Record<K, CodeSpec>>
annotationsreadonly Annotation[]
CodeListSpecinterfaceno test imports it
interface CodeListSpec<K extends string>

What codeList is given.

MemberTypeWhat it is
definition?string
codesReadonly<Record<K, CodeSpec>>
annotations?readonly Annotation[]
CodeSpecinterfaceno test imports it
interface CodeSpec

One code: what a person is shown, and what it means where that is not enough.

MemberTypeWhat it is
labelstring
definition?string
codeListfunction
function codeList<const N extends string, const K extends string>(name: N, spec: CodeListSpec<K>): CodeList<N, K>

Makes a code list; total, it never fails (domain says what is wrong).

ParameterWhat it is
nameits name
specits definition, its codes and its annotations

Returns: the code list, frozen

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

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