(rawPath: string, root: string)
| 116 | } |
| 117 | |
| 118 | function normalize(rawPath: string, root: string): string { |
| 119 | const expanded = rawPath.startsWith("~") |
| 120 | ? rawPath.replace(/^~/, process.env.HOME ?? "~") |
| 121 | : rawPath; |
| 122 | const abs = isAbsolute(expanded) ? expanded : resolve(root, expanded); |
| 123 | const rel = relative(resolve(root), resolve(abs)); |
| 124 | return rel.split(sep).join(posix.sep); |
| 125 | } |
| 126 | |
| 127 | function extractPaths(payload: unknown, root: string): string[] { |
| 128 | if (typeof payload !== "object" || payload === null) { |