coverage_matrix.ts

The coverage matrix: which languages each library claims, with a numbered footnote wherever the support is indirect.

view source

Declarations
#

3 declarations

CoverageCell
#

coverage_matrix.ts view source

CoverageCell

type { kind: "direct"; } | { kind: "via"; footnote: number; } | { kind: "unsupported"; }

import type {CoverageCell} from '@ryanatkn/syntax-highlighter-bench/coverage_matrix.js';

How one library covers one language.

CoverageMatrix
#

coverage_matrix.ts view source

CoverageMatrix import type {CoverageMatrix} from '@ryanatkn/syntax-highlighter-bench/coverage_matrix.js';

A coverage matrix: a row of cells by library id for each language, and the footnotes.

rows

type { lang: { id: string; label: string; timed: boolean; }; cells: Record<string, CoverageCell>; }[]

footnotes

The footnote texts. A cell's footnote is an index into them.

type string[]

to_coverage_matrix
#

coverage_matrix.ts view source

(results: Pick<{ meta: { generated_at: string | null; machine: { name: string; cpu: string; threads: number | null; governor: string | null; cpufreq_driver: string | null; epp: string | null; boost: boolean | null; memory_gb: number; os_release: string; } | null; ... 10 more ...; bundler: { ...; } | ... 1 more ... | null; }; ... 8 more ...; coverage: Record<...>; }, "langs" | ... 1 more ... | "coverage">): CoverageMatrix import {to_coverage_matrix} from '@ryanatkn/syntax-highlighter-bench/coverage_matrix.js';

Builds the coverage matrix of a results file. Footnotes are numbered in the order the matrix first uses them, reading by row, and a text shared by two libraries is one footnote.

results

type Pick<BenchResults, "langs" | "meta" | "coverage">

returns

CoverageMatrix

Depends on
#

Imported by
#