chore: custom impl for set.difference api (#19135)

This commit is contained in:
Alex 2025-06-12 11:41:19 -05:00 committed by GitHub
parent 0322a8b1d9
commit 144cc8ab6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 5 deletions

View file

@ -216,3 +216,13 @@ export const plainDateTimeCompare = (ascending: boolean, a: TimelinePlainDateTim
}
return aDateTime.millisecond - bDateTime.millisecond;
};
export function setDifference<T>(setA: Set<T>, setB: Set<T>): Set<T> {
const result = new Set<T>();
for (const value of setA) {
if (!setB.has(value)) {
result.add(value);
}
}
return result;
}