MCPcopy Index your code
hub / github.com/Noumena-Network/code / findCommand

Function findCommand

src/commands.ts:699–709  ·  view source on GitHub ↗
(
  commandName: string,
  commands: Command[],
)

Source from the content-addressed store, hash-verified

697}
698
699export 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
711export function hasCommand(commandName: string, commands: Command[]): boolean {
712 return findCommand(commandName, commands) !== undefined

Callers 7

hasCommandFunction · 0.85
getCommandFunction · 0.85
validateInputFunction · 0.85
checkPermissionsFunction · 0.85
callFunction · 0.85
processUserInputBaseFunction · 0.85

Calls 1

getCommandNameFunction · 0.50

Tested by

no test coverage detected