MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / getCollidingPlatformIds

Function getCollidingPlatformIds

packages/core/src/merger/algorithms.ts:61–76  ·  view source on GitHub ↗
(
  sources: Array<{ platform: string; members: Array<{ platformId: string }> }>
)

Source from the content-addressed store, hash-verified

59// ==================== Platform ID collision ====================
60
61export function getCollidingPlatformIds(
62 sources: Array<{ platform: string; members: Array<{ platformId: string }> }>
63): Set<string> {
64 const map = new Map<string, Set<string>>()
65 for (const source of sources) {
66 for (const member of source.members) {
67 if (!map.has(member.platformId)) map.set(member.platformId, new Set())
68 map.get(member.platformId)!.add(source.platform || 'unknown')
69 }
70 }
71 const result = new Set<string>()
72 for (const [id, platforms] of map) {
73 if (platforms.size > 1) result.add(id)
74 }
75 return result
76}
77
78export function getCollidingPlatformIdsFromMessages(
79 allMessages: Array<{ msg: MergerMessage; platform: string }>

Callers 2

algorithms.test.tsFile · 0.90
buildMergedOutputFunction · 0.90

Calls 3

setMethod · 0.80
getMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected