@js-joda/core 5.6.2 → 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.2",
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": "d7328d5a09602b6a7fe5211092c6b7c50ff3b79b"
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) {
@@ -1418,7 +1418,6 @@ export class LocalTime extends Temporal implements TemporalAdjuster {
1418
1418
  toNanoOfDay(): number;
1419
1419
  toSecondOfDay(): number;
1420
1420
  toString(): string;
1421
- toString(): string;
1422
1421
  truncatedTo(unit: ChronoUnit): LocalTime;
1423
1422
  until(endExclusive: Temporal, unit: TemporalUnit): number;
1424
1423
  with(adjuster: TemporalAdjuster): LocalTime;
@@ -1594,6 +1593,7 @@ export class YearMonth extends Temporal implements TemporalAdjuster {
1594
1593
  plusMonths(monthsToAdd: number): YearMonth;
1595
1594
  plusYears(yearsToAdd: number): YearMonth;
1596
1595
  toJSON(): string;
1596
+ toString(): string;
1597
1597
  until(endExclusive: Temporal, unit: TemporalUnit): number;
1598
1598
  with(adjuster: TemporalAdjuster): YearMonth;
1599
1599
  with(field: TemporalField, newValue: number): YearMonth;