MCPcopy Create free account
hub / github.com/codeaashu/claude-code / findMatchedAlias

Function findMatchedAlias

src/utils/suggestions/commandSuggestions.ts:250–259  ·  view source on GitHub ↗

* Checks if a query matches any of the command's aliases. * Returns the matched alias if found, otherwise undefined.

(
  query: string,
  aliases?: string[],
)

Source from the content-addressed store, hash-verified

248 * Returns the matched alias if found, otherwise undefined.
249 */
250function findMatchedAlias(
251 query: string,
252 aliases?: string[],
253): string | undefined {
254 if (!aliases || aliases.length === 0 || query === '') {
255 return undefined
256 }
257 // Check if query is a prefix of any alias (case-insensitive)
258 return aliases.find(alias => alias.toLowerCase().startsWith(query))
259}
260
261/**
262 * Creates a suggestion item from a command.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected