IF Commons GitHub

integrations/pure/registry

The registry of integrations (commons 0019-mizan-integrations FR-002): a typed lookup by the formats an integration reads and writes. An integration is added once; an identifier or a pair of formats and a standard that is already there is refused with a finding, not overwritten.

Source: commons/mizan/src/integrations/pure/registry.ts

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

integrations.emptyRegistryconstno test imports it
const emptyRegistry: Registry

An empty registry.

integrations.lookupfunctionno test imports it
function lookup(r: Registry, q: { readonly direction: Direction; readonly from: Format; readonly to: Format; readonly standard?: string | undefined; }): readonly AnyIntegration[]

The integrations that read a format and write another, of a direction, for a standard (any standard where none is given).

integrations.registerfunctionno test imports it
function register(r: Registry, i: AnyIntegration): Result<Registry, RegistryError>

A registry with the integration added, or why it was not.

integrations.Registrytypeno test imports it
type Registry = { readonly integrations: readonly AnyIntegration[] };

A registry: the integrations added so far, in order.

integrations.RegistryErrortypeno test imports it
type RegistryError =
  | { readonly kind: "id-taken"; readonly id: string }
  | { readonly kind: "pair-taken"; readonly from: Format; readonly to: Format; readonly standard: string; readonly id: string };

Why an integration is not added.

emptyRegistryconst
const emptyRegistry: Registry

An empty registry.

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

lookupfunction
function lookup(r: Registry, q: { readonly direction: Direction; readonly from: Format; readonly to: Format; readonly standard?: string | undefined; }): readonly AnyIntegration[]

The integrations that read a format and write another, of a direction, for a standard (any standard where none is given).

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

registerfunction
function register(r: Registry, i: AnyIntegration): Result<Registry, RegistryError>

A registry with the integration added, or why it was not.

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

Registrytypeno test imports it
type Registry = { readonly integrations: readonly AnyIntegration[] };

A registry: the integrations added so far, in order.

RegistryErrortypeno test imports it
type RegistryError =
  | { readonly kind: "id-taken"; readonly id: string }
  | { readonly kind: "pair-taken"; readonly from: Format; readonly to: Format; readonly standard: string; readonly id: string };

Why an integration is not added.

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