MCPcopy
hub / github.com/Snailclimb/JavaGuide / fetchText

Function fetchText

scripts/docsearch-index.mjs:53–65  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

51}
52
53async function fetchText(url) {
54 const response = await fetch(url, {
55 headers: {
56 "User-Agent": "JavaGuide-DocSearch-Indexer/1.0",
57 },
58 });
59
60 if (!response.ok) {
61 throw new Error(`${url} responded with HTTP ${response.status}`);
62 }
63
64 return response.text();
65}
66
67async function readSitemap() {
68 if (!sourceDir) {

Callers 2

readSitemapFunction · 0.85
readPageHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected