MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / githubApiBase

Function githubApiBase

packages/setupWizard/src/github.ts:8–18  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

6import { createSearchSelectContext, INPUT_THEME, note, toEnvKey } from './utils.js';
7
8function githubApiBase(url: string): string {
9 try {
10 const u = new URL(url);
11 if (u.hostname === 'github.com') {
12 return 'https://api.github.com';
13 }
14 return `${u.protocol}//${u.hostname}/api/v3`;
15 } catch {
16 return 'https://api.github.com';
17 }
18}
19
20type SearchOption = { name: string; value: string };
21type GitHubSearchType = 'org' | 'user' | 'repo';

Callers 1

collectGitHubConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected