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

Function extractSearchToken

src/hooks/useTypeahead.tsx:123–135  ·  view source on GitHub ↗
(completionToken: {
  token: string;
  isQuoted?: boolean;
})

Source from the content-addressed store, hash-verified

121 * @returns The search token with @ and quotes removed
122 */
123export function extractSearchToken(completionToken: {
124 token: string;
125 isQuoted?: boolean;
126}): string {
127 if (completionToken.isQuoted) {
128 // Remove @" prefix and optional closing "
129 return completionToken.token.slice(2).replace(/"$/, '');
130 } else if (completionToken.token.startsWith('@')) {
131 return completionToken.token.substring(1);
132 } else {
133 return completionToken.token;
134 }
135}
136
137/**
138 * Format a replacement value with proper @ prefix and quotes based on context

Callers 1

useTypeaheadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected