(input: { url: URL; remote: string })
| 190 | } |
| 191 | |
| 192 | function buildFile(input: { url: URL; remote: string }) { |
| 193 | const filePath = path.normalize(fileURLToPath(input.url)) |
| 194 | const segments = filePath.split(/[\\/]+/).filter(Boolean) |
| 195 | if (!segments.length) return |
| 196 | return { |
| 197 | host: "file", |
| 198 | path: filePath, |
| 199 | segments: segments.map((segment) => segment.replace(/:$/, "")), |
| 200 | owner: undefined, |
| 201 | repo: trimGitSuffix(segments[segments.length - 1]), |
| 202 | remote: input.remote, |
| 203 | label: filePath, |
| 204 | protocol: "file:", |
| 205 | } satisfies FileReference |
| 206 | } |
| 207 | |
| 208 | export * as Repository from "./repository" |
no test coverage detected