Honor preferContactAvatars field on AccountRecord
This commit is contained in:
parent
f5eb17e0d1
commit
68a458ec4a
9 changed files with 163 additions and 4 deletions
24
ts/util/areArraysMatchingSets.ts
Normal file
24
ts/util/areArraysMatchingSets.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2020-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export function areArraysMatchingSets<T>(
|
||||
left: Array<T>,
|
||||
right: Array<T>
|
||||
): boolean {
|
||||
const leftSet = new Set(left);
|
||||
const rightSet = new Set(right);
|
||||
|
||||
for (const item of leftSet) {
|
||||
if (!rightSet.has(item)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (const item of rightSet) {
|
||||
if (!leftSet.has(item)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue