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