function formatISODuration(duration) {
  __WEBPACK_IMPORTED_MODULE_0__lib_requiredArgs_index_js__["a" /* default */](1, arguments);
  if (typeof duration !== 'object') throw new Error('Duration must be an object');
  var _duration$years = duration.years,
      years = _duration$years === void 0 ? 0 : _duration$years,
      _duration$months = duration.months,
      months = _duration$months === void 0 ? 0 : _duration$months,
      _duration$days = duration.days,
      days = _duration$days === void 0 ? 0 : _duration$days,
      _duration$hours = duration.hours,
      hours = _duration$hours === void 0 ? 0 : _duration$hours,
      _duration$minutes = duration.minutes,
      minutes = _duration$minutes === void 0 ? 0 : _duration$minutes,
      _duration$seconds = duration.seconds,
      seconds = _duration$seconds === void 0 ? 0 : _duration$seconds;
  return "P".concat(years, "Y").concat(months, "M").concat(days, "DT").concat(hours, "H").concat(minutes, "M").concat(seconds, "S");
}
@name formatRFC3339
@category Common Helpers
@summary Format the date according to the ISO 3339 standard (https://tools.ietf.org/html/rfc3339#section-5.6).

@description
Return the formatted date string in ISO 3339 format. Options may be passed to control the parts and notations of the date.

@param {Date|Number} date - the original date
@param {Object} [options] - an object with options.
@param {0|1|2|3} [options.fractionDigits=0] - number of digits after the decimal point after seconds
@returns {String} the formatted date string
@throws {TypeError} 1 argument required
@throws {RangeError} `date` must not be Invalid Date
@throws {RangeError} `options.fractionDigits` must be between 0 and 3

@example
// Represent 18 September 2019 in ISO 3339 format:
const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52))
//=> '2019-09-18T19:00:52Z'

@example
// Represent 18 September 2019 in ISO 3339 format, 2 digits of second fraction:
const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { fractionDigits: 2 })
//=> '2019-09-18T19:00:52.23Z'

@example
// Represent 18 September 2019 in ISO 3339 format, 3 digits of second fraction
const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { fractionDigits: 3 })
//=> '2019-09-18T19:00:52.234Z'