@finnair/v-validation-moment 0.9.1 → 1.1.0-alpha.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.
package/CHANGELOG.md CHANGED
@@ -3,75 +3,71 @@
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
- ## [0.9.1](https://github.com/finnair/v-validation/compare/v0.9.0...v0.9.1) (2020-12-07)
6
+ # [1.1.0-alpha.0](https://github.com/finnair/v-validation/compare/v1.0.1...v1.1.0-alpha.0) (2022-08-12)
7
7
 
8
- **Note:** Version bump only for package @finnair/v-validation-moment
9
8
 
9
+ ### Features
10
10
 
11
+ * Support for Luxon ([6f982df](https://github.com/finnair/v-validation/commit/6f982df9b55395e953069914c93fef677dec171e))
11
12
 
12
13
 
13
14
 
14
- # [0.9.0](https://github.com/finnair/v-validation/compare/v0.8.0...v0.9.0) (2020-09-23)
15
15
 
16
- **Note:** Version bump only for package @finnair/v-validation-moment
17
16
 
17
+ ## [1.0.1](https://github.com/finnair/v-validation/compare/v0.9.1...v1.0.1) (2022-01-20)
18
18
 
19
+ ### Features
19
20
 
21
+ - Add support for Node v14 and v16
22
+ - Update Jest and Lerna
23
+ - Update other vulnerable packages
20
24
 
25
+ ### BREAKING CHANGES
21
26
 
22
- # [0.8.0](https://github.com/finnair/v-validation/compare/v0.7.0...v0.8.0) (2020-09-09)
27
+ - Drop support for Node v10
28
+
29
+ ## [0.9.1](https://github.com/finnair/v-validation/compare/v0.9.0...v0.9.1) (2020-12-07)
23
30
 
24
31
  **Note:** Version bump only for package @finnair/v-validation-moment
25
32
 
33
+ # [0.9.0](https://github.com/finnair/v-validation/compare/v0.8.0...v0.9.0) (2020-09-23)
26
34
 
35
+ **Note:** Version bump only for package @finnair/v-validation-moment
27
36
 
37
+ # [0.8.0](https://github.com/finnair/v-validation/compare/v0.7.0...v0.8.0) (2020-09-09)
28
38
 
39
+ **Note:** Version bump only for package @finnair/v-validation-moment
29
40
 
30
41
  # [0.7.0](https://github.com/finnair/v-validation/compare/v0.6.2...v0.7.0) (2020-08-26)
31
42
 
32
-
33
43
  ### Features
34
44
 
35
- * refactor "then" to "next" ([9b02d2c](https://github.com/finnair/v-validation/commit/9b02d2c6cca8f6a5e44633b6dad2df2ecec28af2))
36
-
45
+ - refactor "then" to "next" ([9b02d2c](https://github.com/finnair/v-validation/commit/9b02d2c6cca8f6a5e44633b6dad2df2ecec28af2))
37
46
 
38
47
  ### BREAKING CHANGES
39
48
 
40
- * Validator:
41
- * then -> next
42
- * thenMap -> nextMap
49
+ - Validator:
50
+ - then -> next
51
+ - thenMap -> nextMap
43
52
 
44
53
  ObjectModel & ClassModel:
45
- * then -> next
46
- * localThen -> localNext
47
-
48
- Signed-off-by: Samppa Saarela <samppa.saarela@iki.fi>
49
-
50
-
51
54
 
55
+ - then -> next
56
+ - localThen -> localNext
52
57
 
58
+ Signed-off-by: Samppa Saarela <samppa.saarela@iki.fi>
53
59
 
54
60
  ## [0.6.2](https://github.com/finnair/v-validation/compare/v0.6.1...v0.6.2) (2020-05-22)
55
61
 
56
-
57
62
  ### Bug Fixes
58
63
 
59
- * Update Moment.js and fix dependencies ([2e9a16d](https://github.com/finnair/v-validation/commit/2e9a16d297994a557133a853ed6556d16552c21a))
60
-
61
-
62
-
63
-
64
+ - Update Moment.js and fix dependencies ([2e9a16d](https://github.com/finnair/v-validation/commit/2e9a16d297994a557133a853ed6556d16552c21a))
64
65
 
65
66
  ## [0.6.1](https://github.com/finnair/v-validation/compare/v0.6.0...v0.6.1) (2020-05-22)
66
67
 
67
-
68
68
  ### Bug Fixes
69
69
 
70
- * NPM ignore node_modules ([9f1264f](https://github.com/finnair/v-validation/commit/9f1264f5086e406d30f94f5a47aa3fb6956d725a))
71
-
72
-
73
-
74
-
70
+ - NPM ignore node_modules ([9f1264f](https://github.com/finnair/v-validation/commit/9f1264f5086e406d30f94f5a47aa3fb6956d725a))
75
71
 
76
72
  # [0.6.0](https://github.com/finnair/v-validation/compare/v0.5.0...v0.6.0) (2020-05-19)
77
73
 
package/dist/Vmoment.js CHANGED
@@ -23,10 +23,10 @@ class MomentValidator extends v_validation_1.Validator {
23
23
  }
24
24
  validatePath(value, path, ctx) {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
- if (v_validation_1.isNullOrUndefined(value)) {
26
+ if ((0, v_validation_1.isNullOrUndefined)(value)) {
27
27
  return ctx.failure(v_validation_1.defaultViolations.notNull(path), value);
28
28
  }
29
- if (v_validation_1.isString(value) || moment_1.default.isMoment(value)) {
29
+ if ((0, v_validation_1.isString)(value) || moment_1.default.isMoment(value)) {
30
30
  const convertedValue = this.parse(value);
31
31
  if (convertedValue.isValid()) {
32
32
  return ctx.success(convertedValue);
@@ -41,13 +41,13 @@ const durationPattern = /^P(?!$)(\d+(?:\.\d+)?Y)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?
41
41
  class DurationValidator extends v_validation_1.Validator {
42
42
  validatePath(value, path, ctx) {
43
43
  return __awaiter(this, void 0, void 0, function* () {
44
- if (v_validation_1.isNullOrUndefined(value)) {
44
+ if ((0, v_validation_1.isNullOrUndefined)(value)) {
45
45
  return ctx.failure(v_validation_1.defaultViolations.notNull(path), value);
46
46
  }
47
- if ((v_validation_1.isString(value) && durationPattern.test(value)) || moment_1.default.isDuration(value)) {
48
- value = moment_1.default.duration(value);
49
- if (value.isValid()) {
50
- return ctx.success(value);
47
+ if (((0, v_validation_1.isString)(value) && durationPattern.test(value)) || moment_1.default.isDuration(value)) {
48
+ const convertedValue = moment_1.default.duration(value);
49
+ if (convertedValue.isValid()) {
50
+ return ctx.success(convertedValue);
51
51
  }
52
52
  }
53
53
  return ctx.failure(new v_validation_1.TypeMismatch(path, 'Duration', value), value);
@@ -56,11 +56,11 @@ class DurationValidator extends v_validation_1.Validator {
56
56
  }
57
57
  exports.DurationValidator = DurationValidator;
58
58
  function maybeDateFormat(value, dateFormat) {
59
- return v_validation_1.isString(value) ? dateFormat : undefined;
59
+ return (0, v_validation_1.isString)(value) ? dateFormat : undefined;
60
60
  }
61
61
  const dateFormat = 'YYYY-MM-DD';
62
62
  function dateMoment(value) {
63
- return Object.setPrototypeOf(moment_1.default(value, maybeDateFormat(value, dateFormat), true), dateMoment.prototype);
63
+ return Object.setPrototypeOf((0, moment_1.default)(value, maybeDateFormat(value, dateFormat), true), dateMoment.prototype);
64
64
  }
65
65
  exports.dateMoment = dateMoment;
66
66
  Object.setPrototypeOf(dateMoment.prototype, moment_1.default.prototype);
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
7
7
  o[k2] = m[k];
8
8
  }));
9
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./Vmoment"), exports);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Vmoment_1 = require("./Vmoment");
4
+ console.log((0, Vmoment_1.timeMoment)('24:00:01').toDate().toISOString());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finnair/v-validation-moment",
3
- "version": "0.9.1",
3
+ "version": "1.1.0-alpha.0",
4
4
  "private": false,
5
5
  "description": "Moment validators",
6
6
  "main": "dist/index.js",
@@ -25,9 +25,9 @@
25
25
  "build": "tsc -b ."
26
26
  },
27
27
  "dependencies": {
28
- "@finnair/path": "^0.9.0",
29
- "@finnair/v-validation": "^0.9.1",
30
- "moment": "2.27.0"
28
+ "@finnair/path": "^1.1.0-alpha.0",
29
+ "@finnair/v-validation": "^1.1.0-alpha.0",
30
+ "moment": "2.29.4"
31
31
  },
32
- "gitHead": "3a3bea340e52e3c81c1caf6017d33e60c940c391"
32
+ "gitHead": "980da25d0eb031a0ed89691c97459b23efcdc8a5"
33
33
  }