(csvRel: string, pages: Record<string, string>)
| 67 | } |
| 68 | |
| 69 | function pagesToRelative(csvRel: string, pages: Record<string, string>): Record<string, string> { |
| 70 | const formDir = formDirFromCsvPath(toPosix(csvRel)) |
| 71 | if (!formDir) return pages |
| 72 | const prefix = `${formDir}/` |
| 73 | return Object.fromEntries( |
| 74 | Object.entries(pages).map(([id, p]) => [id, p.startsWith(prefix) ? p.slice(prefix.length) : p]) |
| 75 | ) |
| 76 | } |
| 77 | |
| 78 | function isMissing(err: unknown): boolean { |
| 79 | return (err as NodeJS.ErrnoException)?.code === 'ENOENT' |
no test coverage detected