( commandName: string, commands: Command[], )
| 697 | } |
| 698 | |
| 699 | export function findCommand( |
| 700 | commandName: string, |
| 701 | commands: Command[], |
| 702 | ): Command | undefined { |
| 703 | return commands.find( |
| 704 | _ => |
| 705 | _.name === commandName || |
| 706 | getCommandName(_) === commandName || |
| 707 | _.aliases?.includes(commandName), |
| 708 | ) |
| 709 | } |
| 710 | |
| 711 | export function hasCommand(commandName: string, commands: Command[]): boolean { |
| 712 | return findCommand(commandName, commands) !== undefined |
no test coverage detected