function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
export function resolvePhoneGridRowKey(record, rowKey) {
  if (typeof rowKey === 'function') {
    return rowKey(record);
  }
  var value = record[rowKey];
  return value == null ? undefined : value;
}
export function mergePhoneGridRowsByRowKey(prev, nextPage, rowKey) {
  if (nextPage.length === 0) return prev;
  var seen = new Set();
  var merged = [];
  var append = function append(row) {
    if (row == null || _typeof(row) !== 'object') return;
    var key = resolvePhoneGridRowKey(row, rowKey);
    if (key != null) {
      if (seen.has(key)) return;
      seen.add(key);
    }
    merged.push(row);
  };
  prev.forEach(append);
  nextPage.forEach(append);
  return merged;
}