diff --git a/web/public/src/data.ts b/web/public/src/data.ts index 484b7bc..fcc4ed6 100644 --- a/web/public/src/data.ts +++ b/web/public/src/data.ts @@ -27,5 +27,5 @@ export type CodeCovEntry = { export async function codeCoverageData(): Promise { return await fetch("/api/code-coverage") .then((v) => v.json()) - .then((v) => v.codeCoveragea); + .then((v) => v.codeCoverage); } diff --git a/web/public/src/index.ts b/web/public/src/index.ts index 8a6555c..4547f4f 100644 --- a/web/public/src/index.ts +++ b/web/public/src/index.ts @@ -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);