(configName: ConfigName)
| 25 | // If it doesn't find one, it then looks for keyserver/{folder}/{name}.json |
| 26 | // In both cases, it expects to find a JSON blob |
| 27 | async function getCommConfig<T>(configName: ConfigName): Promise<?T> { |
| 28 | const key = getKeyForConfigName(configName); |
| 29 | const cached = cachedJSON.get(key); |
| 30 | if (cached !== undefined) { |
| 31 | return (cached: any); |
| 32 | } |
| 33 | const json = await getJSON<T>(configName); |
| 34 | if (!cachedJSON.has(key)) { |
| 35 | cachedJSON.set(key, json); |
| 36 | } |
| 37 | return (cachedJSON.get(key): any); |
| 38 | } |
| 39 | |
| 40 | async function getJSON<T>(configName: ConfigName): Promise<?T> { |
| 41 | const key = getKeyForConfigName(configName); |
no test coverage detected