Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-jonathan committed Dec 2, 2024
1 parent 736972a commit d09e9be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/behavioral/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class PluginManager<T> {
this.plugins = []
}

register(...plugins: Plugin<T>[] | string[]): boolean {
register(...plugins: Plugin<T>[]): boolean {
for (const plugin of plugins) {
const i = this.indexOf(plugin)

Expand Down Expand Up @@ -122,8 +122,8 @@ export class PluginManager<T> {
protected indexOf(plugin: Plugin<T> | string): number {
const plugins = this.plugins
const name = 'string' === typeof plugin
? plugin
: plugin.name
? plugin
: plugin.name

for (let i = plugins.length - 1; i >= 0; --i) {
if (name === plugins[i].name) {
Expand Down

0 comments on commit d09e9be

Please sign in to comment.