fluent-ts-validator
Version:
A fluent validator written in TypeScript
22 lines • 656 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Validates if given number is less than or equal to the threshold value.
*
* @export
* @class IsLessThanOrEqualToValidator
* @implements {PropertyValidator<number>}
*/
class IsLessThanOrEqualToValidator {
constructor(threshold) {
this.threshold = threshold;
}
isValid(input) {
if (typeof input === "undefined" || input === null) {
return false;
}
return input <= this.threshold;
}
}
exports.IsLessThanOrEqualToValidator = IsLessThanOrEqualToValidator;
//# sourceMappingURL=IsLessThanOrEqualToValidator.js.map