11 lines
404 B
TypeScript
11 lines
404 B
TypeScript
|
|
/**
|
||
|
|
* Filter incoming batch results to only those whose participantId
|
||
|
|
* is not already in the set of existing result participantIds.
|
||
|
|
*/
|
||
|
|
export function filterNewResults(
|
||
|
|
incoming: { participantId: string; placement: number }[],
|
||
|
|
existingParticipantIds: Set<string>
|
||
|
|
): { participantId: string; placement: number }[] {
|
||
|
|
return incoming.filter((r) => !existingParticipantIds.has(r.participantId));
|
||
|
|
}
|