@finnair/v-validation-moment 0.8.0 → 1.0.1

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,6 +3,30 @@
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
+ ## [1.0.1](https://github.com/finnair/v-validation/compare/v0.9.1...v1.0.1) (2022-01-20)
7
+
8
+ **Note:** Version bump only for package @finnair/v-validation-moment
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.9.1](https://github.com/finnair/v-validation/compare/v0.9.0...v0.9.1) (2020-12-07)
15
+
16
+ **Note:** Version bump only for package @finnair/v-validation-moment
17
+
18
+
19
+
20
+
21
+
22
+ # [0.9.0](https://github.com/finnair/v-validation/compare/v0.8.0...v0.9.0) (2020-09-23)
23
+
24
+ **Note:** Version bump only for package @finnair/v-validation-moment
25
+
26
+
27
+
28
+
29
+
6
30
  # [0.8.0](https://github.com/finnair/v-validation/compare/v0.7.0...v0.8.0) (2020-09-09)
7
31
 
8
32
  **Note:** Version bump only for package @finnair/v-validation-moment
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,10 +41,10 @@ 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)) {
47
+ if (((0, v_validation_1.isString)(value) && durationPattern.test(value)) || moment_1.default.isDuration(value)) {
48
48
  value = moment_1.default.duration(value);
49
49
  if (value.isValid()) {
50
50
  return ctx.success(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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finnair/v-validation-moment",
3
- "version": "0.8.0",
3
+ "version": "1.0.1",
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.8.0",
29
- "@finnair/v-validation": "^0.8.0",
28
+ "@finnair/path": "^1.0.1",
29
+ "@finnair/v-validation": "^1.0.1",
30
30
  "moment": "2.27.0"
31
31
  },
32
- "gitHead": "fabb67c9516dc2215ea65e4cce1b94c86434fd18"
32
+ "gitHead": "890c4bdff08e421a7732e816b1a0c6d5c3653914"
33
33
  }