'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = configContext => data => {
  var _configContext$record = configContext.recordDataHelpers;
  const deepGet = _configContext$record.deepGet,
        getPart = _configContext$record.getPart;


  if (!data) {
    return '';
  }

  const common = getPart(data, 'collectionobjects_common');

  if (!common) {
    return '';
  }

  const objectNumber = common.get('objectNumber');
  const title = deepGet(common, ['titleGroupList', 'titleGroup', 0, 'title']);

  return [objectNumber, title].filter(part => !!part).join(' – ');
};