'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getScenarioDescription = getScenarioDescription;
exports.getStepKeyword = getStepKeyword;
exports.getStepLineToPickledStepMap = getStepLineToPickledStepMap;

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function getScenarioDescription(_ref) {
  var pickle = _ref.pickle,
      scenarioLineToDescriptionMap = _ref.scenarioLineToDescriptionMap;

  return _lodash2.default.chain(pickle.locations).map(function (_ref2) {
    var line = _ref2.line;
    return scenarioLineToDescriptionMap[line];
  }).compact().first().value();
}

function getStepKeyword(_ref3) {
  var pickleStep = _ref3.pickleStep,
      stepLineToKeywordMap = _ref3.stepLineToKeywordMap;

  return _lodash2.default.chain(pickleStep.locations).map(function (_ref4) {
    var line = _ref4.line;
    return stepLineToKeywordMap[line];
  }).compact().first().value();
}

function getStepLineToPickledStepMap(pickle) {
  return _lodash2.default.chain(pickle.steps).map(function (step) {
    return [_lodash2.default.last(step.locations).line, step];
  }).fromPairs().value();
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9mb3JtYXR0ZXIvaGVscGVycy9waWNrbGVfcGFyc2VyLmpzIl0sIm5hbWVzIjpbImdldFNjZW5hcmlvRGVzY3JpcHRpb24iLCJnZXRTdGVwS2V5d29yZCIsImdldFN0ZXBMaW5lVG9QaWNrbGVkU3RlcE1hcCIsInBpY2tsZSIsInNjZW5hcmlvTGluZVRvRGVzY3JpcHRpb25NYXAiLCJjaGFpbiIsImxvY2F0aW9ucyIsIm1hcCIsImxpbmUiLCJjb21wYWN0IiwiZmlyc3QiLCJ2YWx1ZSIsInBpY2tsZVN0ZXAiLCJzdGVwTGluZVRvS2V5d29yZE1hcCIsInN0ZXBzIiwibGFzdCIsInN0ZXAiLCJmcm9tUGFpcnMiXSwibWFwcGluZ3MiOiI7Ozs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