@webnotion-net/typescript-model-validator
Version:
Flexible and extensible library for validating data models in TypeScript
17 lines (16 loc) • 578 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var Matches = /** @class */ (function () {
function Matches(propertyName, secondPropertyName) {
this.propertyName = propertyName;
this.secondPropertyName = secondPropertyName;
}
Matches.prototype.validate = function (data) {
return data[this.propertyName] === data[this.secondPropertyName];
};
Matches.prototype.getErrorMessage = function () {
return "The provided values doesn't match.";
};
return Matches;
}());
exports.default = Matches;