MCPcopy Index your code
hub / github.com/CodeGraphContext/CodeGraphContext / fetchVersion

Function fetchVersion

website/src/components/HeroSection.tsx:21–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

HeroSectionFunction · 0.70

Calls 2

errorMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected