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

Function fetchVersion

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

Source from the content-addressed store, hash-verified

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

Callers 1

HeroSectionFunction · 0.70

Calls 1

textMethod · 0.45

Tested by

no test coverage detected