UNPKG

fluent-ts-validator

Version:
22 lines 582 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Validates if given date is same as or before than specified date. * * @export * @class IsSameOrBeforeValidator * @implements {PropertyValidator<Date>} */ class IsSameOrBeforeValidator { constructor(date) { this.date = date; } isValid(input) { if (input) { return input.getTime() <= this.date.getTime(); } return false; } } exports.IsSameOrBeforeValidator = IsSameOrBeforeValidator; //# sourceMappingURL=IsSameOrBeforeValidator.js.map