MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / fileQueryPath

Function fileQueryPath

graph-ui/src/search/path-query.ts:2–7  ·  view source on GitHub ↗
(query: string)

Source from the content-addressed store, hash-verified

1/** A repository-relative path request, kept intact instead of split into words. */
2export function fileQueryPath(query: string): string | undefined {
3 const path = query.trim().replace(/\\/g, '/').replace(/^(?:\.\/)+/, '');
4 if (!path || path.startsWith('/') || path.endsWith('/') || /^[A-Za-z]:/.test(path)
5 || /[\x00-\x1f]/.test(path) || path.split('/').some(part => !part || part === '..' || part === '.')) return undefined;
6 return path.includes('/') || /\.[^\s.]+$/.test(path) ? path : undefined;
7}

Callers 4

rankLocalCandidatesFunction · 0.90
rankHitsFunction · 0.90
searchByMeaningFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected