@kerthin/domain
Version:
Kerthin Domain (based on DDD)
13 lines • 556 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsDate = void 0;
const apply_validation_1 = require("./apply-validation");
const IsDate = (validationOptions) => (0, apply_validation_1.applyValidation)({
code: 'IS_DATE',
defaultMessage: 'The value must be a Date instance.',
validate: (value) => {
return value instanceof Date && !isNaN(value === null || value === void 0 ? void 0 : value.getTime());
}
}, validationOptions);
exports.IsDate = IsDate;
//# sourceMappingURL=is-date.validator.js.map