Skip to content

Commit

Permalink
ENGCOM-4672: [2.2] Add support for validation message callback #20107
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaschenko authored Apr 17, 2019
2 parents 8b90f2b + e80acac commit 8e4be79
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ define([
params :
[params];

if (typeof message === 'function') {
message = message.call(rule);
}

message = params.reduce(function (msg, param, idx) {
return msg.replace(new RegExp('\\{' + idx + '\\}', 'g'), param);
}, message);
Expand Down

0 comments on commit 8e4be79

Please sign in to comment.