MCPcopy Index your code
hub / github.com/adobe/react-spectrum / fetchText

Function fetchText

packages/dev/mcp/shared/src/utils.ts:52–64  ·  view source on GitHub ↗
(url: string, timeoutMs = 15000)

Source from the content-addressed store, hash-verified

50}
51
52export async function fetchText(url: string, timeoutMs = 15000): Promise<string> {
53 const ctrl = new AbortController();
54 const id = setTimeout(() => ctrl.abort(), timeoutMs).unref?.();
55 try {
56 const res = await fetch(url, {signal: ctrl.signal, cache: 'no-store'} as any);
57 if (!res.ok) {
58 throw new Error(`HTTP ${res.status} for ${url}`);
59 }
60 return await res.text();
61 } finally {
62 clearTimeout(id as any);
63 }
64}

Callers 3

buildPageIndexFunction · 0.85
ensureParsedPageFunction · 0.85
registerLibraryDocsToolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected