mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-19 11:36:30 +00:00
32 lines
745 B
TypeScript
32 lines
745 B
TypeScript
export type FlameGraphNode = {
|
|
fn: number;
|
|
acc: number;
|
|
parent: number;
|
|
children: FlameGraphNode[];
|
|
};
|
|
|
|
export async function flameGraphData(): Promise<FlameGraphNode> {
|
|
return await fetch("/api/flame-graph")
|
|
.then((v) => v.json())
|
|
.then((v) => v.flameGraph);
|
|
}
|
|
|
|
export async function codeData(): Promise<string> {
|
|
return await fetch("/api/source")
|
|
.then((v) => v.json())
|
|
.then((v) => v.text);
|
|
}
|
|
|
|
export type CodeCovEntry = {
|
|
index: number;
|
|
line: number;
|
|
col: number;
|
|
covers: number;
|
|
};
|
|
|
|
export async function codeCoverageData(): Promise<CodeCovEntry[]> {
|
|
return await fetch("/api/code-coverage")
|
|
.then((v) => v.json())
|
|
.then((v) => v.codeCoveragea);
|
|
}
|