mirror of
https://github.com/element-hq/element-call.git
synced 2026-10-10 05:18:18 +00:00
Let layoutShallowEquals compare any layout-shaped object
This commit is contained in:
@@ -150,10 +150,11 @@ export type Layout =
|
||||
| PipLayout;
|
||||
|
||||
/**
|
||||
* Tests whether the top-level properties and array elements of layout `a` are
|
||||
* equal to those of layout `b`. Useful for deduping redundant layout updates.
|
||||
* Tests whether the top-level properties and array elements of `a` are equal
|
||||
* to those of `b`. Useful for deduping redundant layout and layout media
|
||||
* updates.
|
||||
*/
|
||||
export function layoutShallowEquals(a: Layout, b: Layout): boolean {
|
||||
export function layoutShallowEquals<T extends object>(a: T, b: T): boolean {
|
||||
// If a and b have the same number of keys and every key in a is also in b,
|
||||
// then they have the same keys.
|
||||
const aKeys = Object.keys(a);
|
||||
|
||||
Reference in New Issue
Block a user