fix entry rendering
This commit is contained in:
parent
ed279f7998
commit
9b4b9982d0
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user