* Helper function to find a plugin from loaded plugins
( plugin: string, plugins: LoadedPlugin[], )
| 204 | * Helper function to find a plugin from loaded plugins |
| 205 | */ |
| 206 | function findPluginByIdentifier( |
| 207 | plugin: string, |
| 208 | plugins: LoadedPlugin[], |
| 209 | ): LoadedPlugin | undefined { |
| 210 | const { name, marketplace } = parsePluginIdentifier(plugin) |
| 211 | |
| 212 | return plugins.find(p => { |
| 213 | // Check exact name match |
| 214 | if (p.name === plugin || p.name === name) return true |
| 215 | |
| 216 | // If marketplace specified, check if it matches the source |
| 217 | if (marketplace && p.source) { |
| 218 | return p.name === name && p.source.includes(`@${marketplace}`) |
| 219 | } |
| 220 | |
| 221 | return false |
| 222 | }) |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * Resolve a plugin ID from V2 installed plugins data for a plugin that may |
no test coverage detected