(
sources: Array<{ platform: string; members: Array<{ platformId: string }> }>
)
| 59 | // ==================== Platform ID collision ==================== |
| 60 | |
| 61 | export 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 | |
| 78 | export function getCollidingPlatformIdsFromMessages( |
| 79 | allMessages: Array<{ msg: MergerMessage; platform: string }> |
no test coverage detected