1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.IsDateString = exports.isDateString = exports.IS_DATE_STRING = void 0;
|
4 | const ValidateBy_1 = require("../common/ValidateBy");
|
5 | const IsISO8601_1 = require("./IsISO8601");
|
6 | exports.IS_DATE_STRING = 'isDateString';
|
7 |
|
8 |
|
9 |
|
10 | function isDateString(value, options) {
|
11 | return (0, IsISO8601_1.isISO8601)(value, options);
|
12 | }
|
13 | exports.isDateString = isDateString;
|
14 |
|
15 |
|
16 |
|
17 | function IsDateString(options, validationOptions) {
|
18 | return (0, ValidateBy_1.ValidateBy)({
|
19 | name: exports.IS_DATE_STRING,
|
20 | constraints: [options],
|
21 | validator: {
|
22 | validate: (value, args) => isDateString(value),
|
23 | defaultMessage: (0, ValidateBy_1.buildMessage)(eachPrefix => eachPrefix + '$property must be a valid ISO 8601 date string', validationOptions),
|
24 | },
|
25 | }, validationOptions);
|
26 | }
|
27 | exports.IsDateString = IsDateString;
|
28 |
|
\ | No newline at end of file |