"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getOccupationFromParty = void 0;
var _getChildrenAmount = require("./getChildrenAmount");
const getOccupationFromParty = function () {
  let party = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  return party.reduce(function (total) {
    let {
      adults = 0,
      children = []
    } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    return {
      adults: total.adults + (Number(adults) || 0),
      children: total.children + (0, _getChildrenAmount.getChildrenAmount)(children)
    };
  }, {
    adults: 0,
    children: 0
  });
};
exports.getOccupationFromParty = getOccupationFromParty;
//# sourceMappingURL=getOccupationFromParty.js.map