11 lines
377 B
JavaScript
11 lines
377 B
JavaScript
module.exports = function(Self) {
|
|
Self.validateBinded = function(propertyName, validatorFn, options) {
|
|
var customValidator = function(err) {
|
|
if (!validatorFn(this[propertyName])) err();
|
|
};
|
|
options.isExportable = true;
|
|
options.bindedFunction = validatorFn;
|
|
this.validate(propertyName, customValidator, options);
|
|
};
|
|
};
|