* Attach a new %%plugin%% to this Network. The network name * must be unique, excluding any fragment.
(plugin)
| 114 | * must be unique, excluding any fragment. |
| 115 | */ |
| 116 | attachPlugin(plugin) { |
| 117 | if (this.#plugins.get(plugin.name)) { |
| 118 | throw new Error(`cannot replace existing plugin: ${plugin.name} `); |
| 119 | } |
| 120 | this.#plugins.set(plugin.name, plugin.clone()); |
| 121 | return this; |
| 122 | } |
| 123 | /** |
| 124 | * Return the plugin, if any, matching %%name%% exactly. Plugins |
| 125 | * with fragments will not be returned unless %%name%% includes |