MCPcopy Create free account
hub / github.com/CommE2E/comm / getCommConfig

Function getCommConfig

lib/utils/comm-config.js:27–38  ·  view source on GitHub ↗
(configName: ConfigName)

Source from the content-addressed store, hash-verified

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
27async 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
40async function getJSON<T>(configName: ConfigName): Promise<?T> {
41 const key = getKeyForConfigName(configName);

Callers 7

fetchURLFactsFunction · 0.90
getNeynarConfigFunction · 0.90
getSendmailFunction · 0.90
versionResponderFunction · 0.90
getBackupConfigFunction · 0.90
getConfigFunction · 0.85
getConfigFunction · 0.85

Calls 4

getKeyForConfigNameFunction · 0.85
getMethod · 0.65
hasMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected