@finnair/v-validation-luxon
Advanced tools
Comparing version 1.1.0-alpha.8 to 1.1.0-alpha.9
@@ -6,2 +6,10 @@ # Change Log | ||
# [1.1.0-alpha.9](https://github.com/finnair/v-validation/compare/v1.1.0-alpha.8...v1.1.0-alpha.9) (2022-08-19) | ||
**Note:** Version bump only for package @finnair/v-validation-luxon | ||
# [1.1.0-alpha.8](https://github.com/finnair/v-validation/compare/v1.1.0-alpha.7...v1.1.0-alpha.8) (2022-08-19) | ||
@@ -8,0 +16,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const luxon_1 = require("luxon"); | ||
console.log(luxon_1.DateTime.fromFormat('20220819095432+0', 'yyyyMMddHHmmssZ').toJSON()); | ||
console.log(luxon_1.DateTime.fromFormat('2022-08-19+0', 'yyyy-MM-ddZ').toJSON()); |
@@ -13,3 +13,3 @@ import { ValidationContext, Validator, ValidationResult } from '@finnair/v-validation'; | ||
pattern: RegExp; | ||
parser: (value: string) => DateTime; | ||
parser: (value: string, match: RegExpExecArray) => DateTime; | ||
} | ||
@@ -16,0 +16,0 @@ export declare function validateLuxon({ value, path, ctx, type, proto, pattern, parser }: ValidateLuxonParams): Promise<ValidationResult>; |
@@ -30,4 +30,5 @@ "use strict"; | ||
else if ((0, v_validation_1.isString)(value)) { | ||
if (pattern.test(value)) { | ||
const dateTime = parser(value); | ||
const match = pattern.exec(value); | ||
if (match) { | ||
const dateTime = parser(value, match); | ||
if (dateTime.isValid) { | ||
@@ -34,0 +35,0 @@ return ctx.success(new proto(dateTime)); |
{ | ||
"name": "@finnair/v-validation-luxon", | ||
"version": "1.1.0-alpha.8", | ||
"version": "1.1.0-alpha.9", | ||
"private": false, | ||
@@ -35,3 +35,3 @@ "description": "Luxon validators", | ||
}, | ||
"gitHead": "883052983f33664439c1baae629ed5f6d53cbdcb" | ||
"gitHead": "dcae3dd01e676de15d600898de5188c8384cb360" | ||
} |
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
29157
527