(plugins: Origin[])
| 62 | // Dedupe on the load identity (package name for npm specs, exact file URL for local specs), but keep the |
| 63 | // full Origin so downstream code still knows which config file won and where follow-up writes should go. |
| 64 | export function deduplicatePluginOrigins(plugins: Origin[]): Origin[] { |
| 65 | const seen = new Set<string>() |
| 66 | const list: Origin[] = [] |
| 67 | |
| 68 | for (const plugin of plugins.toReversed()) { |
| 69 | const spec = pluginSpecifier(plugin.spec) |
| 70 | const name = spec.startsWith("file://") ? spec : parsePluginSpecifier(spec).pkg |
| 71 | if (seen.has(name)) continue |
| 72 | seen.add(name) |
| 73 | list.push(plugin) |
| 74 | } |
| 75 | |
| 76 | return list.toReversed() |
| 77 | } |
| 78 | |
| 79 | export * as ConfigPlugin from "./plugin" |
nothing calls this directly
no test coverage detected