fix entry rendering

This commit is contained in:
Theis Pieter Hollebeek 2024-12-12 12:12:46 +01:00
parent ed279f7998
commit 9b4b9982d0
2 changed files with 6 additions and 3 deletions

View File

@ -27,5 +27,5 @@ export type CodeCovEntry = {
export async function codeCoverageData(): Promise<CodeCovEntry[]> { export async function codeCoverageData(): Promise<CodeCovEntry[]> {
return await fetch("/api/code-coverage") return await fetch("/api/code-coverage")
.then((v) => v.json()) .then((v) => v.json())
.then((v) => v.codeCoveragea); .then((v) => v.codeCoverage);
} }

View File

@ -2,11 +2,14 @@ import * as data from "./data.ts";
function loadCodeCoverage( function loadCodeCoverage(
text: string, text: string,
data: data.CodeCovEntry[], input: data.CodeCovEntry[],
container: HTMLPreElement, container: HTMLPreElement,
tooltip: HTMLElement, tooltip: HTMLElement,
) { ) {
const entries = data.toSorted(( if (input.length === 0) {
return;
}
const entries = input.toSorted((
a: data.CodeCovEntry, a: data.CodeCovEntry,
b: data.CodeCovEntry, b: data.CodeCovEntry,
) => b.index - a.index); ) => b.index - a.index);