signal-desktop/ts/util/areObjectEntriesEqual.ts
2021-10-29 18:19:44 -05:00

8 lines
255 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export const areObjectEntriesEqual = <T>(
a: Readonly<T>,
b: Readonly<T>,
keys: ReadonlyArray<keyof T>
): boolean => a === b || keys.every(key => a[key] === b[key]);