(configPath?: string)
| 76 | |
| 77 | |
| 78 | export 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 | |
| 100 | export const getRepoIdFromPath = (repoPath: string): number | undefined => { |
| 101 | const id = parseInt(path.basename(repoPath), 10); |
no test coverage detected