(path: string)
| 214 | |
| 215 | describe("buildFileDisplayLabels", () => { |
| 216 | const makeFile = (path: string) => { |
| 217 | const segment = path.split("/").pop() ?? path; |
| 218 | const basename = segment.replace(/\.md$/, ""); |
| 219 | const parentPath = path.includes("/") |
| 220 | ? path.slice(0, path.lastIndexOf("/")) |
| 221 | : "/"; |
| 222 | return { basename, parent: { path: parentPath } } as never; |
| 223 | }; |
| 224 | |
| 225 | it("uses bare basenames when unambiguous", () => { |
| 226 | const labels = buildFileDisplayLabels([ |