Looks enough like a path to bother stat-ing (avoids treating prose words as paths).
(tok: string)
| 72 | |
| 73 | /** Looks enough like a path to bother stat-ing (avoids treating prose words as paths). */ |
| 74 | function 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 | |
| 79 | export interface FsPath { abs: string; kind: 'dir' | 'file'; name: string; } |
| 80 |
no test coverage detected