(token: string, cwd: string)
| 28 | } |
| 29 | |
| 30 | function resolvePath(token: string, cwd: string): string { |
| 31 | let p = unescape(token).trim(); |
| 32 | if (p.startsWith('~/') || p === '~') p = path.join(os.homedir(), p.slice(1)); |
| 33 | return path.isAbsolute(p) ? p : path.resolve(cwd, p); |
| 34 | } |
| 35 | |
| 36 | /** Distinct, existing image file paths referenced in `text` (resolved absolute). */ |
| 37 | export function findImagePaths(text: string, cwd: string): string[] { |
no test coverage detected