MCPcopy Create free account
hub / github.com/adobe/react-spectrum / isSetEqual

Function isSetEqual

packages/react-stately/src/virtualizer/utils.ts:14–30  ·  view source on GitHub ↗
(a: Set<T>, b: Set<T>)

Source from the content-addressed store, hash-verified

12
13/** Returns whether two sets are equal. */
14export function isSetEqual<T>(a: Set<T>, b: Set<T>): boolean {
15 if (a === b) {
16 return true;
17 }
18
19 if (a.size !== b.size) {
20 return false;
21 }
22
23 for (let key of a) {
24 if (!b.has(key)) {
25 return false;
26 }
27 }
28
29 return true;
30}

Callers 1

renderMethod · 0.90

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected