pouchdb-validation
Advanced tools
Comparing version 1.1.2 to 1.1.3
16
index.js
@@ -64,13 +64,13 @@ /* | ||
if (typeof e.unauthorized !== "undefined") { | ||
throw { | ||
throw new PouchPluginError({ | ||
name: "unauthorized", | ||
message: e.unauthorized, | ||
status: 401 | ||
}; | ||
}); | ||
} else if (typeof e.forbidden !== "undefined") { | ||
throw { | ||
throw new PouchPluginError({ | ||
name: "forbidden", | ||
message: e.forbidden, | ||
status: 403 | ||
}; | ||
}); | ||
} else { | ||
@@ -207,3 +207,7 @@ throw coucheval.wrapExecutionError(e); | ||
var validations = bulkDocs.docs.map(function (doc) { | ||
if (!Array.isArray(bulkDocs)) { | ||
bulkDocs = bulkDocs.docs; | ||
} | ||
var validations = bulkDocs.map(function (doc) { | ||
doc._id = doc._id || uuid.v4(); | ||
@@ -220,3 +224,3 @@ var validationPromise = doValidation(args.db, doc, args.options); | ||
var allValidationsPromise = Promise.all(validations).then(function () { | ||
return methods(args.db).bulkDocs({docs: notYetDone}, args.options); | ||
return methods(args.db).bulkDocs(notYetDone, args.options); | ||
}).then(function (insertedDocs) { | ||
@@ -223,0 +227,0 @@ return done.concat(insertedDocs); |
{ | ||
"name": "pouchdb-validation", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"main": "index.js", | ||
@@ -29,3 +29,3 @@ "description": "A PouchDB plug-in that allows you to re-use your CouchDB validate_doc_update functions on the client side.", | ||
"node-uuid": "^1.4.1", | ||
"pouchdb-plugin-error": "^0.1.0" | ||
"pouchdb-plugin-error": "^0.2.0" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10407
268
+ Addedpouchdb-plugin-error@0.2.0(transitive)
- Removedpouchdb-plugin-error@0.1.0(transitive)
Updatedpouchdb-plugin-error@^0.2.0