()
| 161 | * present. The object is an untyped object as there are no required user configurations. |
| 162 | */ |
| 163 | export async function getUserConfig() { |
| 164 | // If the global config is not defined, load it from the file system. |
| 165 | if (userConfig === null) { |
| 166 | // The full path to the configuration file. |
| 167 | const configPath = join(determineRepoBaseDirFromCwd(), USER_CONFIG_FILE_PATH); |
| 168 | // Set the global config object. |
| 169 | userConfig = await readConfigFile(configPath, true); |
| 170 | } |
| 171 | // Return a clone of the user config to ensure that a new instance of the config is returned |
| 172 | // each time, preventing unexpected effects of modifications to the config object. |
| 173 | return {...userConfig}; |
| 174 | } |
| 175 | |
| 176 | /** A standard error class to thrown during assertions while validating configuration. */ |
| 177 | export class ConfigValidationError extends Error { |
no test coverage detected