diff --git a/common/util/array.ts b/common/util/array.ts index 8a429262..fd5efcc6 100644 --- a/common/util/array.ts +++ b/common/util/array.ts @@ -1,3 +1,5 @@ +import { isEqual } from 'lodash' + export function filterDefined(array: (T | null | undefined)[]) { return array.filter((item) => item !== null && item !== undefined) as T[] } @@ -26,7 +28,7 @@ export function groupConsecutive(xs: T[], key: (x: T) => U) { let curr = { key: key(xs[0]), items: [xs[0]] } for (const x of xs.slice(1)) { const k = key(x) - if (k !== curr.key) { + if (!isEqual(key, curr.key)) { result.push(curr) curr = { key: k, items: [x] } } else {