@finnair/v-validation-moment
Advanced tools
Comparing version 7.0.0-alpha.5 to 7.0.0-alpha.6
@@ -6,2 +6,8 @@ # Change Log | ||
# [7.0.0-alpha.6](https://github.com/finnair/v-validation/compare/v7.0.0-alpha.5...v7.0.0-alpha.6) (2024-11-18) | ||
### Bug Fixes | ||
- some validators throwing instead of returning Promise.reject ([c00876d](https://github.com/finnair/v-validation/commit/c00876ddb77d8deefcf38c8e9a05749b8c7f1cff)) | ||
# [7.0.0-alpha.5](https://github.com/finnair/v-validation/compare/v7.0.0-alpha.4...v7.0.0-alpha.5) (2024-11-14) | ||
@@ -8,0 +14,0 @@ |
@@ -27,3 +27,3 @@ "use strict"; | ||
if ((0, v_validation_1.isNullOrUndefined)(value)) { | ||
return ctx.failure(v_validation_1.defaultViolations.notNull(path), value); | ||
return Promise.reject(v_validation_1.defaultViolations.notNull(path)); | ||
} | ||
@@ -36,3 +36,3 @@ if ((0, v_validation_1.isString)(value) || moment_1.default.isMoment(value)) { | ||
} | ||
throw v_validation_1.defaultViolations.date(value, path, this.type); | ||
return Promise.reject(v_validation_1.defaultViolations.date(value, path, this.type)); | ||
} | ||
@@ -45,3 +45,3 @@ } | ||
if ((0, v_validation_1.isNullOrUndefined)(value)) { | ||
return ctx.failure(v_validation_1.defaultViolations.notNull(path), value); | ||
return Promise.reject(v_validation_1.defaultViolations.notNull(path)); | ||
} | ||
@@ -54,3 +54,3 @@ if (((0, v_validation_1.isString)(value) && durationPattern.test(value)) || moment_1.default.isDuration(value)) { | ||
} | ||
return ctx.failure(new v_validation_1.TypeMismatch(path, 'Duration', value), value); | ||
return Promise.reject(new v_validation_1.TypeMismatch(path, 'Duration', value)); | ||
} | ||
@@ -57,0 +57,0 @@ } |
@@ -14,3 +14,3 @@ import { Validator, isNullOrUndefined, defaultViolations, isString, TypeMismatch } from '@finnair/v-validation'; | ||
if (isNullOrUndefined(value)) { | ||
return ctx.failure(defaultViolations.notNull(path), value); | ||
return Promise.reject(defaultViolations.notNull(path)); | ||
} | ||
@@ -23,3 +23,3 @@ if (isString(value) || moment.isMoment(value)) { | ||
} | ||
throw defaultViolations.date(value, path, this.type); | ||
return Promise.reject(defaultViolations.date(value, path, this.type)); | ||
} | ||
@@ -31,3 +31,3 @@ } | ||
if (isNullOrUndefined(value)) { | ||
return ctx.failure(defaultViolations.notNull(path), value); | ||
return Promise.reject(defaultViolations.notNull(path)); | ||
} | ||
@@ -40,3 +40,3 @@ if ((isString(value) && durationPattern.test(value)) || moment.isDuration(value)) { | ||
} | ||
return ctx.failure(new TypeMismatch(path, 'Duration', value), value); | ||
return Promise.reject(new TypeMismatch(path, 'Duration', value)); | ||
} | ||
@@ -43,0 +43,0 @@ } |
{ | ||
"name": "@finnair/v-validation-moment", | ||
"version": "7.0.0-alpha.5", | ||
"version": "7.0.0-alpha.6", | ||
"private": false, | ||
@@ -48,6 +48,6 @@ "description": "Moment validators", | ||
"devDependencies": { | ||
"@finnair/path": "^7.0.0-alpha.5", | ||
"@finnair/v-validation": "^7.0.0-alpha.5" | ||
"@finnair/path": "^7.0.0-alpha.6", | ||
"@finnair/v-validation": "^7.0.0-alpha.6" | ||
}, | ||
"gitHead": "852a94df835ad85ce3f4ac92a285403f57ca3d02" | ||
"gitHead": "468a1d6fd29ab8ec10915603731dee7a07dac97c" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64743