@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)
@@ -230,11 +230,7 @@ var MathUtil = function () {
230
230
  if (isNaN(value)) {
231
231
  throw new ArithmeticException('Invalid int value, using NaN as argument');
232
232
  }
233
- if (Number.isInteger) {
234
- if (!Number.isInteger(Number(value))) {
235
- throw new ArithmeticException("Invalid value: '" + value + "' is a float");
236
- }
237
- } else if (value % 1 !== 0) {
233
+ if (!Number.isInteger(Number(value))) {
238
234
  throw new ArithmeticException("Invalid value: '" + value + "' is a float");
239
235
  }
240
236
  if (value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER) {
@@ -10420,12 +10416,7 @@ function nativeJs(date, zone) {
10420
10416
  }
10421
10417
  requireNonNull(date, 'date');
10422
10418
  requireNonNull(zone, 'zone');
10423
- if (date instanceof Date) {
10424
- return Instant.ofEpochMilli(date.getTime()).atZone(zone);
10425
- } else if (typeof date.toDate === 'function' && date.toDate() instanceof Date) {
10426
- return Instant.ofEpochMilli(date.toDate().getTime()).atZone(zone);
10427
- }
10428
- throw new IllegalArgumentException('date must be a javascript Date or a moment instance');
10419
+ return Instant.ofEpochMilli(date.valueOf()).atZone(zone);
10429
10420
  }
10430
10421
 
10431
10422
  function bindUse(jsJoda) {