( commandName: string, commands: Command[], )
| 688 | } |
| 689 | |
| 690 | export function findCommand( |
| 691 | commandName: string, |
| 692 | commands: Command[], |
| 693 | ): Command | undefined { |
| 694 | return commands.find( |
| 695 | _ => |
| 696 | _.name === commandName || |
| 697 | getCommandName(_) === commandName || |
| 698 | _.aliases?.includes(commandName), |
| 699 | ) |
| 700 | } |
| 701 | |
| 702 | export function hasCommand(commandName: string, commands: Command[]): boolean { |
| 703 | return findCommand(commandName, commands) !== undefined |
no test coverage detected