(a: Set<T>, b: Set<T>)
| 394 | |
| 395 | // Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384 |
| 396 | export const setsEqual = <T>(a: Set<T>, b: Set<T>) => { |
| 397 | if (a.size !== b.size) { |
| 398 | return false; |
| 399 | } |
| 400 | |
| 401 | for (const item of a) { |
| 402 | if (!b.has(item)) { |
| 403 | return false; |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | return true; |
| 408 | }; |
| 409 | |
| 410 | /** |
| 411 | * @param e - The event |
no test coverage detected