(newConfig: ConfigFn | Partial<Config>)
| 62 | } |
| 63 | |
| 64 | export function configure(newConfig: ConfigFn | Partial<Config>) { |
| 65 | if (typeof newConfig === 'function') { |
| 66 | // Pass the existing config out to the provided function |
| 67 | // and accept a delta in return |
| 68 | newConfig = newConfig(config) |
| 69 | } |
| 70 | |
| 71 | // Merge the incoming config delta |
| 72 | config = { |
| 73 | ...config, |
| 74 | ...newConfig, |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | export function getConfig() { |
| 79 | return config |
no outgoing calls
no test coverage detected