IF Commons GitHub

logical/convert

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-csf2-package FR-001, 0002-csf2-package FR-004

The conversion of NIST's CSF 2.0 JSON into the grc.framework document (0002-csf2-package FR-001, FR-004): a pure function of the source value. The active subcategories are the ones the source does not withdraw (a withdrawn one has a WR-<id> record that it projects to); each becomes a control with its statement, the title of its category and its category as the family.

import { convert } from "./convert.ts";
const r = convert({ elements: [], relationships: [] }); // { functions: [], categories: [], controls: [] }

Source: commons/catalog-nist-csf-2/src/logical/convert.ts

Mutation score of this file: 72.1% (17 of 61 changes to its code were not noticed by a test).

2 of 12 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.SourceElementtypeno test imports it
type SourceElement = { readonly element_type: string; readonly element_identifier: string; readonly title: string; readonly text: string };

A record of the source: what NIST's data service calls an element.

logical.SourceRelationshiptypeno test imports it
type SourceRelationship = { readonly source_element_identifier: string; readonly dest_element_identifier: string; readonly relationship_identifier: string };

A relationship of the source.

logical.Sourcetypeno test imports it
type Source = { readonly elements: readonly SourceElement[]; readonly relationships: readonly SourceRelationship[] };

The part of the source this conversion reads.

logical.ConvertedControltypeno test imports it
type ConvertedControl = { readonly id: string; readonly title: string; readonly statement: string; readonly family: string };

A control of the framework.

logical.Convertedtypeno test imports it
type Converted = { readonly functions: readonly string[]; readonly categories: readonly string[]; readonly controls: readonly ConvertedControl[] };

What the source gives: the identifiers of the functions and active categories, and the controls.

logical.convertfunctionno test imports it
function convert(source: Source): Converted

The active controls of the source, sorted by identifier.

SourceElementtypeno test imports it
type SourceElement = { readonly element_type: string; readonly element_identifier: string; readonly title: string; readonly text: string };

A record of the source: what NIST's data service calls an element.

SourceRelationshiptypeno test imports it
type SourceRelationship = { readonly source_element_identifier: string; readonly dest_element_identifier: string; readonly relationship_identifier: string };

A relationship of the source.

Sourcetype
type Source = { readonly elements: readonly SourceElement[]; readonly relationships: readonly SourceRelationship[] };

The part of the source this conversion reads.

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

ConvertedControltypeno test imports it
type ConvertedControl = { readonly id: string; readonly title: string; readonly statement: string; readonly family: string };

A control of the framework.

Convertedtypeno test imports it
type Converted = { readonly functions: readonly string[]; readonly categories: readonly string[]; readonly controls: readonly ConvertedControl[] };

What the source gives: the identifiers of the functions and active categories, and the controls.

convertfunction
function convert(source: Source): Converted

The active controls of the source, sorted by identifier.

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

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