'use strict';

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

exports.default = function (pluginContext) {
  return function (data) {
    var _pluginContext$record = pluginContext.recordDataHelpers,
        deepGet = _pluginContext$record.deepGet,
        getPart = _pluginContext$record.getPart;


    if (!data) {
      return '';
    }

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

    if (!common) {
      return '';
    }

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

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