MCPcopy Index your code
hub / github.com/danvk/webdiff / getThickDiff

Function getThickDiff

ts/file_diff.ts:7–17  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

5
6/** Get thick file diff information from the server. */
7export async function getThickDiff(index: number): Promise<ThickDiff> {
8 const {cache} = getThickDiff;
9 if (cache[index]) {
10 return cache[index];
11 }
12
13 const response = await fetch(`/thick/${index}`);
14 const data = (await response.json()) as ThickDiff;
15 cache[index] = data;
16 return data;
17}
18getThickDiff.cache = [] as ThickDiff[];
19
20// Useful for avoiding capturing keyboard shortcuts and text entry.

Callers 1

DiffViewFunction · 0.90

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected