MCPcopy Create free account
hub / github.com/modelcontextprotocol/ext-apps / fill

Function fill

examples/pdf-server/server.test.ts:83–92  ·  view source on GitHub ↗
(cache: PdfCache, url: string)

Source from the content-addressed store, hash-verified

81 const tenBytes = new Uint8Array(10);
82
83 async function fill(cache: PdfCache, url: string): Promise<void> {
84 const m = spyOn(globalThis, "fetch").mockResolvedValueOnce(
85 new Response(tenBytes, { status: 200 }),
86 );
87 try {
88 await cache.readPdfRange(url, 0, 1024);
89 } finally {
90 m.mockRestore();
91 }
92 }
93
94 it("evicts least-recently-used entry when total exceeds cap", async () => {
95 const cache = createPdfCache(25);

Callers 1

server.test.tsFile · 0.85

Calls 1

readPdfRangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…