@js-joda/core 5.6.3 → 5.6.5
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/dist/js-joda.cjs.js +32 -4
- package/dist/js-joda.cjs.js.map +1 -1
- package/dist/js-joda.esm.js +32 -4
- package/dist/js-joda.esm.js.map +1 -1
- package/dist/js-joda.js +32 -4
- package/dist/js-joda.js.map +1 -1
- package/dist/js-joda.min.js +2 -2
- package/package.json +3 -3
- package/src/MathUtil.js +5 -1
- package/typings/js-joda.d.ts +1 -1
- package/typings/js-joda.flow.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@js-joda/core",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.5",
|
|
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,
|
|
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",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"sourceMap": false,
|
|
49
49
|
"instrument": false
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "0e0db1449c1ac7eb1d38ba0852fa11e3ae598e48"
|
|
52
52
|
}
|
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 (
|
|
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) {
|
package/typings/js-joda.d.ts
CHANGED
|
@@ -1579,7 +1579,7 @@ export class YearMonth extends Temporal implements TemporalAdjuster {
|
|
|
1579
1579
|
isBefore(other: YearMonth): boolean;
|
|
1580
1580
|
isLeapYear(): boolean;
|
|
1581
1581
|
isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
|
|
1582
|
-
isValidDay(): boolean;
|
|
1582
|
+
isValidDay(dayOfMonth: number): boolean;
|
|
1583
1583
|
lengthOfMonth(): number;
|
|
1584
1584
|
lengthOfYear(): number;
|
|
1585
1585
|
minus(amountToSubtract: number, unit: TemporalUnit): YearMonth;
|
package/typings/js-joda.flow.js
CHANGED
|
@@ -759,7 +759,7 @@ declare module "js-joda" {
|
|
|
759
759
|
monthValue(): number;
|
|
760
760
|
month(): Month;
|
|
761
761
|
isLeapYear(): boolean;
|
|
762
|
-
isValidDay(): boolean;
|
|
762
|
+
isValidDay(dayOfMonth: number): boolean;
|
|
763
763
|
lengthOfMonth(): number;
|
|
764
764
|
lengthOfYear(): number;
|
|
765
765
|
atDay(dayOfMonth: number): LocalDate;
|