(items: ManagedPathItem[])
| 84 | } |
| 85 | |
| 86 | function uniquePathItems(items: ManagedPathItem[]) { |
| 87 | const seen = new Set<string>() |
| 88 | const output: ManagedPathItem[] = [] |
| 89 | for (const item of items) { |
| 90 | if (!item?.path) { |
| 91 | continue |
| 92 | } |
| 93 | const key = `${item.name}:${item.path}` |
| 94 | if (seen.has(key)) { |
| 95 | continue |
| 96 | } |
| 97 | seen.add(key) |
| 98 | output.push(item) |
| 99 | } |
| 100 | return output |
| 101 | } |
| 102 | |
| 103 | function makePathItem(name: string, path?: string): ManagedPathItem | undefined { |
| 104 | if (!path) { |
no test coverage detected