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[]> {
return await fetch("/api/code-coverage")
.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(
text: string,
data: data.CodeCovEntry[],
input: data.CodeCovEntry[],
container: HTMLPreElement,
tooltip: HTMLElement,
) {
const entries = data.toSorted((
if (input.length === 0) {
return;
}
const entries = input.toSorted((
a: data.CodeCovEntry,
b: data.CodeCovEntry,
) => b.index - a.index);