mirror of
https://github.com/koush/scrypted.git
synced 2026-02-12 10:02:04 +00:00
13 lines
268 B
TypeScript
13 lines
268 B
TypeScript
export function hasSameElements<T>(a: T[], b: T[]): boolean {
|
|
const s1 = new Set(a);
|
|
const s2 = new Set(b);
|
|
if (s1.size != s2.size)
|
|
return false;
|
|
for (const e of s1) {
|
|
if (!s2.has(e))
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|