@finnair/v-validation-moment
Advanced tools
Comparing version 0.9.1 to 1.0.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [1.0.0](https://github.com/finnair/v-validation/compare/v0.9.1...v1.0.0) (2022-01-20) | ||
**Note:** Version bump only for package @finnair/v-validation-moment | ||
## [0.9.1](https://github.com/finnair/v-validation/compare/v0.9.0...v0.9.1) (2020-12-07) | ||
@@ -8,0 +16,0 @@ |
@@ -10,5 +10,5 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./Vmoment"), exports); |
@@ -26,6 +26,6 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (v_validation_1.isNullOrUndefined(value)) { | ||
if ((0, v_validation_1.isNullOrUndefined)(value)) { | ||
return ctx.failure(v_validation_1.defaultViolations.notNull(path), value); | ||
} | ||
if (v_validation_1.isString(value) || moment_1.default.isMoment(value)) { | ||
if ((0, v_validation_1.isString)(value) || moment_1.default.isMoment(value)) { | ||
const convertedValue = this.parse(value); | ||
@@ -45,6 +45,6 @@ if (convertedValue.isValid()) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (v_validation_1.isNullOrUndefined(value)) { | ||
if ((0, v_validation_1.isNullOrUndefined)(value)) { | ||
return ctx.failure(v_validation_1.defaultViolations.notNull(path), value); | ||
} | ||
if ((v_validation_1.isString(value) && durationPattern.test(value)) || moment_1.default.isDuration(value)) { | ||
if (((0, v_validation_1.isString)(value) && durationPattern.test(value)) || moment_1.default.isDuration(value)) { | ||
value = moment_1.default.duration(value); | ||
@@ -61,7 +61,7 @@ if (value.isValid()) { | ||
function maybeDateFormat(value, dateFormat) { | ||
return v_validation_1.isString(value) ? dateFormat : undefined; | ||
return (0, v_validation_1.isString)(value) ? dateFormat : undefined; | ||
} | ||
const dateFormat = 'YYYY-MM-DD'; | ||
function dateMoment(value) { | ||
return Object.setPrototypeOf(moment_1.default(value, maybeDateFormat(value, dateFormat), true), dateMoment.prototype); | ||
return Object.setPrototypeOf((0, moment_1.default)(value, maybeDateFormat(value, dateFormat), true), dateMoment.prototype); | ||
} | ||
@@ -68,0 +68,0 @@ exports.dateMoment = dateMoment; |
{ | ||
"name": "@finnair/v-validation-moment", | ||
"version": "0.9.1", | ||
"version": "1.0.0", | ||
"private": false, | ||
@@ -28,7 +28,7 @@ "description": "Moment validators", | ||
"dependencies": { | ||
"@finnair/path": "^0.9.0", | ||
"@finnair/v-validation": "^0.9.1", | ||
"@finnair/path": "^1.0.0", | ||
"@finnair/v-validation": "^1.0.0", | ||
"moment": "2.27.0" | ||
}, | ||
"gitHead": "3a3bea340e52e3c81c1caf6017d33e60c940c391" | ||
"gitHead": "bd40a739be8c006e46f0b9f59426f435a971389b" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
17691
0
1
+ Added@finnair/path@1.1.0(transitive)
+ Added@finnair/v-validation@1.1.0(transitive)
- Removed@finnair/path@0.9.0(transitive)
- Removed@finnair/v-validation@0.9.1(transitive)
Updated@finnair/path@^1.0.0
Updated@finnair/v-validation@^1.0.0