MCPcopy
hub / github.com/upstash/context7 / isGitHubRepo

Function isGitHubRepo

packages/cli/src/commands/generate.ts:182–188  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

180 };
181
182 const isGitHubRepo = (id: string): boolean => {
183 const cleanId = id.startsWith("/") ? id.slice(1) : id;
184 const parts = cleanId.split("/");
185 if (parts.length !== 2) return false;
186 const nonGitHubPrefixes = ["websites", "packages", "npm", "docs", "libraries", "llmstxt"];
187 return !nonGitHubPrefixes.includes(parts[0].toLowerCase());
188 };
189
190 const libraries = searchResult.results.slice(0, 5);
191 const indexWidth = libraries.length.toString().length;

Callers 1

generateCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected