'use strict';

const _ = require('lodash');
const log = require('utils/log.js');

module.exports = function (data, callback) {
  log.silly('parse: %s', __filename);

  if (!_.isEmpty(data.software)) {
    const soft = _.find(data.software, { name: 'unattended-upgrades' });

    if (!_.isEmpty(soft)) {
      data.autoupdate = 2;
    }
  }

  callback(null, data);
};
