( ideType: IdeType, forceRefresh = false, )
| 151 | const pluginInstalledPromiseCache = new Map<IdeType, Promise<boolean>>() |
| 152 | |
| 153 | async function isJetBrainsPluginInstalledMemoized( |
| 154 | ideType: IdeType, |
| 155 | forceRefresh = false, |
| 156 | ): Promise<boolean> { |
| 157 | if (!forceRefresh) { |
| 158 | const existing = pluginInstalledPromiseCache.get(ideType) |
| 159 | if (existing) { |
| 160 | return existing |
| 161 | } |
| 162 | } |
| 163 | const promise = isJetBrainsPluginInstalled(ideType).then(result => { |
| 164 | pluginInstalledCache.set(ideType, result) |
| 165 | return result |
| 166 | }) |
| 167 | pluginInstalledPromiseCache.set(ideType, promise) |
| 168 | return promise |
| 169 | } |
| 170 | |
| 171 | export async function isJetBrainsPluginInstalledCached( |
| 172 | ideType: IdeType, |
no test coverage detected