ansman/validate.js

[help] single async?

Closed this issue · 1 comments

How to use asynchronous rules in a validate.single function.
Thanks in advance.

This is not currently supported, wouldn't be too hard to implement yourself however:

validate.async.single = function(value, constraints, options) {
  options = v.extend({}, v.single.options, options, {
    format: "flat",
    fullMessages: false
  });
  return validate.async({single: value}, {single: constraints}, options);
}