export function getConfigValue()

in typescript/src/utils/ssmConfig.ts [51:65]


export function getConfigValue<A>(key: string, defaultValue?: A): Promise<A> {
  return fetchConfig().then((conf) => {
    if (conf[key]) {
      return conf[key];
    } else {
      if (defaultValue) {
        return defaultValue;
      } else {
        throw new Error(
          `No config value for key: /${App}/${Stage}/${Stack}/${key}`,
        );
      }
    }
  });
}