Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Rule(null, function (options, commit) {
rule.operator($.extend(null, options, opts), commit);
});
} else {
function getMsgOptions(param, ruleName, self) {
var options = $.extend({}, param, {
element: self.element,
display: (param && param.display) || self.get('display'),
rule: ruleName
});
var message = self.get('errormessage' + upperFirstLetter(ruleName)) || self.get('errormessage');
if (message && !options.message) {
options.message = {
failure: message
};
}
return options;
}
$.each(rules, function(i, item) {
var obj = utils.parseRule(item),
ruleName = obj.name,
param = obj.param;
if (theRule === ruleName) {
message = Rule.getMessage($.extend(options || {}, getMsgOptions(param, ruleName, self)), isSuccess);
}
});
return message;