Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Merge ddc1a85 into 07f64ec
Browse files Browse the repository at this point in the history
  • Loading branch information
bbusschots-mu committed Jul 31, 2017
2 parents 07f64ec + ddc1a85 commit 014d8a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ node_modules
lcov.info
coverage*
_SpecRunner.html
*.komodoproject
3 changes: 2 additions & 1 deletion validate.js
Expand Up @@ -17,6 +17,7 @@
// * grouped - Returns the messages grouped by attribute (default)
// * detailed - Returns an array of the raw validation data
// - fullMessages (boolean) - If `true` (default) the attribute name is prepended to the error.
// - allowPromises (boolean) - If `true` no error will be thrown if a promise is passed as an attribute.
//
// Please note that the options are also passed to each validator.
var validate = function(attributes, constraints, options) {
Expand All @@ -28,7 +29,7 @@

for (attr in results) {
for (validator in results[attr]) {
if (v.isPromise(results[attr][validator])) {
if (v.isPromise(results[attr][validator]) && !options.allowPromises) {
throw new Error("Use validate.async if you want support for promises");
}
}
Expand Down

0 comments on commit 014d8a5

Please sign in to comment.