(cmd: Command)
| 34 | commands: Command[] = []; |
| 35 | |
| 36 | addCommand(cmd: Command) { |
| 37 | if (this.commands.find(v => matchesCommand(cmd, v.name, v.group?.name, v.group?.parent?.name))) { |
| 38 | throw new Error(`Duplicate commands registered! Cmd: ${cmd.name}, parent: ${cmd.group?.name}, parent of parent: ${cmd.group?.parent?.name}`); |
| 39 | } |
| 40 | |
| 41 | this.commands.push(cmd); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @internal |
no test coverage detected