@js-joda/core 5.7.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- //! @version @js-joda/core - 5.7.0
1
+ //! @version @js-joda/core - 6.0.0
2
2
  //! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
3
3
  //! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
4
4
  //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
@@ -228,11 +228,7 @@ var MathUtil = function () {
228
228
  if (isNaN(value)) {
229
229
  throw new ArithmeticException('Invalid int value, using NaN as argument');
230
230
  }
231
- if (Number.isInteger) {
232
- if (!Number.isInteger(Number(value))) {
233
- throw new ArithmeticException("Invalid value: '" + value + "' is a float");
234
- }
235
- } else if (value % 1 !== 0) {
231
+ if (!Number.isInteger(Number(value))) {
236
232
  throw new ArithmeticException("Invalid value: '" + value + "' is a float");
237
233
  }
238
234
  if (value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER) {
@@ -10418,12 +10414,7 @@ function nativeJs(date, zone) {
10418
10414
  }
10419
10415
  requireNonNull(date, 'date');
10420
10416
  requireNonNull(zone, 'zone');
10421
- if (date instanceof Date) {
10422
- return Instant.ofEpochMilli(date.getTime()).atZone(zone);
10423
- } else if (typeof date.toDate === 'function' && date.toDate() instanceof Date) {
10424
- return Instant.ofEpochMilli(date.toDate().getTime()).atZone(zone);
10425
- }
10426
- throw new IllegalArgumentException('date must be a javascript Date or a moment instance');
10417
+ return Instant.ofEpochMilli(date.valueOf()).atZone(zone);
10427
10418
  }
10428
10419
 
10429
10420
  function bindUse(jsJoda) {