@atlaskit/dynamic-table
Version:
A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.
22 lines (21 loc) • 549 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validateSortKey = void 0;
var validateSortKey = exports.validateSortKey = function validateSortKey(sortKey, head) {
if (!sortKey) {
return;
}
var headHasKey = head && head.cells.map(function (cell) {
return cell.key;
}).includes(sortKey);
if (!headHasKey) {
try {
throw Error("Cell with ".concat(sortKey, " key not found in head."));
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
}
}
};