Skip to content

Commit 9d0d98a

Browse files
committed
Multiple attributes with the same rule, but different arguments to the
rule are overwritten. The index on the list of rules is by rule name, and doesn't take into account different rule arguments. This fix appends an '_' + ruleValue to the dictionary of rules to make same rules with different arguments unique.
1 parent 823b2fb commit 9d0d98a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function _executeRules(options, value, key, prefix, errors, deepQueue, ruleQueue
9999
let rule = _this.parent.rules[ruleKey] || defaultRules[ruleKey];
100100
// Asynchronous rules get added to the queue
101101
if (rule.async) {
102-
ruleQueue[ruleKey] = ((r, key, val, rVal) => {
102+
ruleQueue[ruleKey + '_' + ruleValue] = ((r, key, val, rVal) => {
103103
return next => {
104104
r(val, rVal, err => {
105105
next(null, { err: err, key: key });

0 commit comments

Comments
 (0)