@js-joda/core 5.6.3 → 5.6.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js-joda/core",
3
- "version": "5.6.3",
3
+ "version": "5.6.4",
4
4
  "description": "a date and time library for javascript",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,7 +31,7 @@
31
31
  "test": "NODE_ENV=test npx mocha --timeout 5000 --require @babel/register ./test/*Test_mochaOnly.js ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js",
32
32
  "test-coverage": "NODE_ENV=test COVERAGE=1 npx nyc --report-dir=build/coverage --reporter=lcov --reporter html npx mocha --timeout 5000 --require @babel/register --reporter progress ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js",
33
33
  "test-browser": "npx karma start --reporters=dots --single-run",
34
- "test-saucelabs": "npx karma start --reporters=\"dots,saucelabs\" --browsers=\"sl_chrome,sl_ie,sl_firefox\" --single-run=true",
34
+ "test-saucelabs": "npx karma start --reporters=\"dots,saucelabs\" --browsers=\"sl_chrome,sl_firefox\" --single-run=true",
35
35
  "test-ci": "npm run build-dist && npm run test && npm run test-browser && npm run test-ts-definitions && npm run test-coverage",
36
36
  "test-ts-definitions": "TS_NODE_PROJECT='../../shared/ts-test-config.json' NODE_ENV=test mocha --timeout 5000 --require ts-node/register ./test/typescript_definitions/*.ts",
37
37
  "build-dist": "npx rollup -c rollup.config.js",
@@ -47,6 +47,5 @@
47
47
  "nyc": {
48
48
  "sourceMap": false,
49
49
  "instrument": false
50
- },
51
- "gitHead": "9ec01ca9278354413546df9570bc18c4295780da"
50
+ }
52
51
  }
package/src/MathUtil.js CHANGED
@@ -168,7 +168,11 @@ export class MathUtil {
168
168
  if (isNaN(value)) {
169
169
  throw new ArithmeticException('Invalid int value, using NaN as argument');
170
170
  }
171
- if ((value % 1) !== 0) {
171
+ if (Number.isInteger) {
172
+ if (!Number.isInteger(Number(value))) {
173
+ throw new ArithmeticException(`Invalid value: '${value}' is a float`);
174
+ }
175
+ } else if ((value % 1) !== 0) { // IE11 does not support Number.isInteger
172
176
  throw new ArithmeticException(`Invalid value: '${value}' is a float`);
173
177
  }
174
178
  if (value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER) {