Debian Codegraph @

node/@patternfly/react-table/src/components/Table/base/columns-are-equal.ts

raw
1 /**
2 * columns-are-equal.ts
3 *
4 * Forked from reactabular-table version 8.14.0
5 * https://github.com/reactabular/reactabular/tree/v8.14.0/packages/reactabular-table/src
6 */
7 import isEqualWith from 'lodash/isEqualWith';
8 import { ColumnsType } from './types';
9
10 /**
11 * @param {ColumnsType} oldColumns - previous columns
12 * @param {ColumnsType} newColumns - new columns
13 */
14 export function columnsAreEqual(oldColumns: ColumnsType, newColumns: ColumnsType) {
15 return isEqualWith(oldColumns, newColumns, (a, b) => {
16 if (typeof a === 'function' && typeof b === 'function') {
17 return a === b;
18 }
19
20 return undefined;
21 });
22 }