(plugin: PlatformPlugin)
| 146 | * last-writer-wins. |
| 147 | */ |
| 148 | export function registerPlatformPlugin(plugin: PlatformPlugin): void { |
| 149 | for (const platform of plugin.platforms) { |
| 150 | if (registry.has(platform)) { |
| 151 | throw new Error(`PlatformPlugin already registered for platform "${platform}"`); |
| 152 | } |
| 153 | registry.set(platform, plugin); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Returns the plugin for `platform`, throwing the SAME `UNSUPPORTED_PLATFORM` |
no test coverage detected