MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / looksLikePathToken

Function looksLikePathToken

src/utils/image-paths.ts:74–77  ·  view source on GitHub ↗

Looks enough like a path to bother stat-ing (avoids treating prose words as paths).

(tok: string)

Source from the content-addressed store, hash-verified

72
73/** Looks enough like a path to bother stat-ing (avoids treating prose words as paths). */
74function looksLikePathToken(tok: string): boolean {
75 const t = unescape(tok).trim().replace(/^['"]|['"]$/g, '');
76 return t.includes('/') || t.startsWith('~') || t.startsWith('.') || path.isAbsolute(t);
77}
78
79export interface FsPath { abs: string; kind: 'dir' | 'file'; name: string; }
80

Callers 1

splitPathsAndTextFunction · 0.85

Calls 1

unescapeFunction · 0.85

Tested by

no test coverage detected