()
| 68 | } |
| 69 | |
| 70 | async loadKeys() { |
| 71 | await Promise.all( |
| 72 | asyncKeys.map(async key => { |
| 73 | if (typeof this[`_${key}`] === 'function') { |
| 74 | try { |
| 75 | this[key] = await this[`_${key}`](); |
| 76 | } catch (error) { |
| 77 | throw new Error(`Failed to resolve async config key '${key}': ${error.message}`); |
| 78 | } |
| 79 | } |
| 80 | }) |
| 81 | ); |
| 82 | |
| 83 | const cachedConfig = AppCache.get(this.appId); |
| 84 | if (cachedConfig) { |
| 85 | const updatedConfig = { ...cachedConfig }; |
| 86 | asyncKeys.forEach(key => { |
| 87 | updatedConfig[key] = this[key]; |
| 88 | }); |
| 89 | AppCache.put(this.appId, updatedConfig); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | static transformConfiguration(serverConfiguration) { |
| 94 | for (const key of Object.keys(serverConfiguration)) { |
no test coverage detected