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

Function getConfigSettings

packages/shared/src/utils.ts:78–98  ·  view source on GitHub ↗
(configPath?: string)

Source from the content-addressed store, hash-verified

76
77
78export const getConfigSettings = async (configPath?: string): Promise<ConfigSettings> => {
79 if (!configPath) {
80 return DEFAULT_CONFIG_SETTINGS;
81 }
82
83 const config = await loadConfig(configPath);
84
85 return {
86 ...DEFAULT_CONFIG_SETTINGS,
87 ...config.settings,
88 // Fall back to deprecated experiment_ variants if new keys are not set.
89 repoDrivenPermissionSyncIntervalMs:
90 config.settings?.repoDrivenPermissionSyncIntervalMs
91 ?? config.settings?.experiment_repoDrivenPermissionSyncIntervalMs
92 ?? DEFAULT_CONFIG_SETTINGS.repoDrivenPermissionSyncIntervalMs,
93 userDrivenPermissionSyncIntervalMs:
94 config.settings?.userDrivenPermissionSyncIntervalMs
95 ?? config.settings?.experiment_userDrivenPermissionSyncIntervalMs
96 ?? DEFAULT_CONFIG_SETTINGS.userDrivenPermissionSyncIntervalMs,
97 }
98}
99
100export const getRepoIdFromPath = (repoPath: string): number | undefined => {
101 const id = parseInt(path.basename(repoPath), 10);

Callers 4

index.tsFile · 0.90
ConnectionDetailPageFunction · 0.90
page.tsxFile · 0.90
utils.test.tsFile · 0.85

Calls 1

loadConfigFunction · 0.85

Tested by

no test coverage detected