MCPcopy
hub / github.com/xpf0000/FlyEnv / uniquePathItems

Function uniquePathItems

src/main/core/MCPContextResolver.ts:86–101  ·  view source on GitHub ↗
(items: ManagedPathItem[])

Source from the content-addressed store, hash-verified

84}
85
86function 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
103function makePathItem(name: string, path?: string): ManagedPathItem | undefined {
104 if (!path) {

Callers 2

buildSiteManagedFilesMethod · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected