UNPKG

@atlaskit/dynamic-table

Version:

A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.

14 lines 363 B
export const validateSortKey = (sortKey, head) => { if (!sortKey) { return; } const headHasKey = head && head.cells.map(cell => cell.key).includes(sortKey); if (!headHasKey) { try { throw Error(`Cell with ${sortKey} key not found in head.`); } catch (e) { // eslint-disable-next-line no-console console.error(e); } } };