(filePath: string)
| 157 | * Returns an array of scope entries, or an empty array if no scopes are defined. |
| 158 | */ |
| 159 | export function readScopes(filePath: string): ScopeEntry[] { |
| 160 | const fileDir = path.dirname(filePath); |
| 161 | const configPath = findConfigFile(fileDir); |
| 162 | if (!configPath) return []; |
| 163 | |
| 164 | const config = readConfig(configPath); |
| 165 | if (!config?.scopes) return []; |
| 166 | |
| 167 | return Object.entries(config.scopes) |
| 168 | .filter(([, def]) => def !== null) |
| 169 | .map(([name, def]) => ({ |
| 170 | name, |
| 171 | description: def?.description, |
| 172 | })); |
| 173 | } |
no test coverage detected