(path: string)
| 9 | const DEFAULT_TIMEOUT = 30_000; |
| 10 | |
| 11 | function resolveInsideCwd(path: string) { |
| 12 | const cwd = process.cwd(); |
| 13 | const resolved = resolve(cwd, path); |
| 14 | const rel = relative(cwd, resolved); |
| 15 | |
| 16 | if (rel.startsWith("..") || isAbsolute(rel)) { |
| 17 | throw new Error("Path is outside the project directory"); |
| 18 | } |
| 19 | |
| 20 | return { cwd, resolved }; |
| 21 | } |
| 22 | |
| 23 | function truncate(value: string, limit: number) { |
| 24 | return value.length > limit |