IF Commons GitHub

engine/id

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-engine FR-003

The identifier of an extension (commons data 0002-engine FR-003): lower-case words joined by - or ., such as privacy or sql.documentation. It is a branded string made only by extensionId, so that a name that was not checked cannot be used where an identifier is wanted.

Source: commons/data/engine/id.ts

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

ExtensionIdtype
type ExtensionId = Brand<string, "ExtensionId">;

The identifier of an extension.

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

extensionIdfunction
function extensionId(text: string): Result<ExtensionId, IdError>

Checks a text as an identifier.

ParameterWhat it is
textthe text

Returns: the identifier, or the text that is not one

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

IdErrortypeno test imports it
type IdError = { readonly kind: "id"; readonly text: string };

Why a text is not an identifier.

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