@finnair/v-validation-luxon 3.0.0-alpha.1 → 3.0.0-alpha.2
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/CHANGELOG.md +11 -0
- package/dist/luxon.js +8 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.0.0-alpha.2](https://github.com/finnair/v-validation/compare/v2.0.0...v3.0.0-alpha.2) (2022-09-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Use SyncPromise also in schema and luxon ([792fbb4](https://github.com/finnair/v-validation/commit/792fbb4c78d07ea085d669312fef5e44e7a397fd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.0.0-alpha.1](https://github.com/finnair/v-validation/compare/v2.0.0...v3.0.0-alpha.1) (2022-09-26)
|
|
7
18
|
|
|
8
19
|
|
package/dist/luxon.js
CHANGED
|
@@ -5,15 +5,21 @@ exports.DateTimeMillisUtcLuxon = exports.DateTimeMillisLuxon = exports.DateTimeU
|
|
|
5
5
|
const luxon_1 = require("luxon");
|
|
6
6
|
class LuxonDateTime {
|
|
7
7
|
constructor(input) {
|
|
8
|
-
if (input
|
|
8
|
+
if (input === null || input === undefined) {
|
|
9
|
+
throw new Error('invalid input (null or undefined), expected DateTime or LuxonDateTime');
|
|
10
|
+
}
|
|
11
|
+
else if (input instanceof LuxonDateTime) {
|
|
9
12
|
this.dateTime = this.normalize(input.dateTime);
|
|
10
13
|
}
|
|
11
|
-
else {
|
|
14
|
+
else if (input instanceof luxon_1.DateTime) {
|
|
12
15
|
if (!input.isValid) {
|
|
13
16
|
throw new Error('Invalid DateTime: ' + input.invalidExplanation);
|
|
14
17
|
}
|
|
15
18
|
this.dateTime = this.normalize(input);
|
|
16
19
|
}
|
|
20
|
+
else {
|
|
21
|
+
throw new Error('invalid input, expected DateTime or LuxonDateTime');
|
|
22
|
+
}
|
|
17
23
|
Object.freeze(this);
|
|
18
24
|
}
|
|
19
25
|
apply(fn) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finnair/v-validation-luxon",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Luxon validators",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"build": "tsc -b ."
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@finnair/path": "^3.0.0-alpha.
|
|
29
|
-
"@finnair/v-validation": "^3.0.0-alpha.
|
|
28
|
+
"@finnair/path": "^3.0.0-alpha.2",
|
|
29
|
+
"@finnair/v-validation": "^3.0.0-alpha.2",
|
|
30
30
|
"luxon": "3.0.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/luxon": "3.0.1"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "d42bd7583bb684429e48ce8e5db3938cb95ffd5f"
|
|
36
36
|
}
|