text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = undefined;
  
  var _buildMessage = require('./buildMessage');
  
  var _buildMessage2 = _interopRequireDefault(_buildMessage);
  
  var _logger = require('../logger');
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var ParseOutput = function ParseOutput(outputMessages, fileName, fileContents, options) {
    // Run the messages through the parser
    var messageLog = outputMessages.map(function (message) {
  
      // Each message will return as an array, [messageType, messagePipe]
      var messageType = message[0];
      var messagePipe = message[1];
  
      // If the type is wcaglint done hop out of the loop
      if (messageType === 'wcaglint.done') {
        return;
      }
  
      return (0, _buildMessage2.default)(messagePipe, fileContents, options);
    });
  
    // Filter out no messages
    messageLog = messageLog.filter(function (message) {
      return message;
    });
  
    // If verbose is true then push the output through to the terminal
    var counters = {
      error: 0,
      notice: 0,
      warning: 0
    };
  
    var updateCounter = function updateCounter(heading) {
      return counters[heading.toLowerCase()]++;
    };
  
    messageLog.forEach(function (message) {
  
      if (options.verbose) {
        (0, _logger.generalMessage)(message);
      }
  
      updateCounter(message.heading);
    });
  
    // If there are messages then the files are not lint free
    var lintFree = counters.error || counters.warning || counters.notice ? false : true;
  
    return { fileName: fileName, lintFree: lintFree, counters: counters, messageLog: messageLog };
  };
  
  exports.default = ParseOutput;