(mod: Record<string, unknown>)
| 93 | } |
| 94 | |
| 95 | function getLegacyPlugins(mod: Record<string, unknown>) { |
| 96 | const seen = new Set<unknown>() |
| 97 | const result: PluginInstance[] = [] |
| 98 | |
| 99 | for (const entry of Object.values(mod)) { |
| 100 | if (seen.has(entry)) continue |
| 101 | seen.add(entry) |
| 102 | const plugin = getServerPlugin(entry) |
| 103 | if (!plugin) throw new TypeError("Plugin export is not a function") |
| 104 | result.push(plugin) |
| 105 | } |
| 106 | |
| 107 | return result |
| 108 | } |
| 109 | |
| 110 | async function applyPlugin(load: PluginLoader.Loaded, input: PluginInput, hooks: Hooks[]) { |
| 111 | const plugin = readV1Plugin(load.mod, load.spec, "server", "detect") |
no test coverage detected