MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / segmentMatchesToken

Function segmentMatchesToken

apps/cli/src/tooling.ts:366–374  ·  view source on GitHub ↗
(segment: string, queryToken: string)

Source from the content-addressed store, hash-verified

364};
365
366const segmentMatchesToken = (segment: string, queryToken: string): boolean => {
367 const normalizedSegment = segment.toLowerCase();
368 const segmentTokens = tokenizeSegment(segment);
369 const variants = tokenVariants(queryToken);
370 return variants.some((variant) => {
371 if (normalizedSegment.includes(variant)) return true;
372 return segmentTokens.some((token) => token === variant || token.startsWith(variant));
373 });
374};
375
376export const filterToolPathChildren = (
377 children: ReadonlyArray<ToolPathChildEntry>,

Callers 1

filterToolPathChildrenFunction · 0.85

Calls 2

tokenizeSegmentFunction · 0.85
tokenVariantsFunction · 0.85

Tested by

no test coverage detected