function isWithinInterval(dirtyDate, dirtyInterval) {
  __WEBPACK_IMPORTED_MODULE_1__lib_requiredArgs_index_js__["a" /* default */](2, arguments);
  var interval = dirtyInterval || {};
  var time = __WEBPACK_IMPORTED_MODULE_0__toDate_index_js__["a" /* default */](dirtyDate).getTime();
  var startTime = __WEBPACK_IMPORTED_MODULE_0__toDate_index_js__["a" /* default */](interval.start).getTime();
  var endTime = __WEBPACK_IMPORTED_MODULE_0__toDate_index_js__["a" /* default */](interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`

  if (!(startTime <= endTime)) {
    throw new RangeError('Invalid interval');
  }

  return time >= startTime && time <= endTime;
}
@name lastDayOfDecade
@category Decade Helpers
@summary Return the last day of a decade for the given date.

@description
Return the last day of a decade for the given date.

### v2.0.0 breaking changes:

- [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).

@param {Date|Number} date - the original date
@returns {Date} the last day of a decade
@throws {TypeError} 1 argument required

@example
// The last day of a decade for 21 December 2012 21:12:00:
var result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00))
//=> Wed Dec 31 2019 00:00:00