(
baseEntity: ApiEntity | undefined,
headEntity: ApiEntity | undefined,
details: Omit<Match, "base" | "head">
)
| 403 | const suggestedMatches: Array<Match> = [] |
| 404 | |
| 405 | const addMatch = ( |
| 406 | baseEntity: ApiEntity | undefined, |
| 407 | headEntity: ApiEntity | undefined, |
| 408 | details: Omit<Match, "base" | "head"> |
| 409 | ): boolean => { |
| 410 | if ( |
| 411 | baseEntity === undefined || headEntity === undefined || |
| 412 | !unmatchedBase.has(baseEntity.id) || !unmatchedHead.has(headEntity.id) |
| 413 | ) { |
| 414 | return false |
| 415 | } |
| 416 | unmatchedBase.delete(baseEntity.id) |
| 417 | unmatchedHead.delete(headEntity.id) |
| 418 | matches.push({ base: baseEntity, head: headEntity, ...details }) |
| 419 | return true |
| 420 | } |
| 421 | |
| 422 | for (const baseEntity of unmatchedBase.values()) { |
| 423 | addMatch(baseEntity, unmatchedHead.get(baseEntity.id), { |
no test coverage detected