MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / fetchVersion

Function fetchVersion

website/src/components/Footer.tsx:23–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22 useEffect(() => {
23 async function fetchVersion() {
24 try {
25 const res = await fetch(
26 "https://raw.githubusercontent.com/CodeGraphContext/CodeGraphContext/main/README.md",
27 );
28 if (!res.ok) throw new Error("Failed to fetch README");
29 const text = await res.text();
30 const match = text.match(
31 /\*\*Version:\*\*\s*([0-9]+\.[0-9]+\.[0-9]+)/i,
32 );
33 setVersion(match ? match[1] : "N/A");
34 } catch (err) {
35 console.error(err);
36 setVersion("N/A");
37 }
38 }
39 fetchVersion();
40 }, []);
41

Callers 1

FooterFunction · 0.70

Calls 2

errorMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected