function durationToMilliseconds(duration) {
  const {
    years = 0,
    months = 0,
    weeks = 0,
    days = 0,
    hours = 0,
    minutes = 0,
    seconds = 0,
    milliseconds = 0
  } = duration;
  const totalDays = years * 365 + months * 30 + weeks * 7 + days;
  const totalHours = totalDays * 24 + hours;
  const totalMinutes = totalHours * 60 + minutes;
  const totalSeconds = totalMinutes * 60 + seconds;
  const totalMilliseconds = totalSeconds * 1e3 + milliseconds;
  return totalMilliseconds;
}

export { durationToMilliseconds };
//# sourceMappingURL=index.esm.js.map
