From 4c0fd6f112eac0e36cead507ef91c7ab36773ec3 Mon Sep 17 00:00:00 2001 From: Marten de Vries Date: Tue, 27 May 2014 15:28:23 +0200 Subject: [PATCH] Show and list now directly call _show and _list when using the HTTP adapter. Validation doesn't occur offline if the server handles it. No test suite regressions, but both are still experimental. (And JS coverage is lower.) --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1d0022c..8bc4555 100644 --- a/index.js +++ b/index.js @@ -16,8 +16,6 @@ "use strict"; -//TODO: call http equivalent if http adapter - var coucheval = require("couchdb-eval"); var couchdb_objects = require("couchdb-objects"); var nodify = require("promise-nodify"); @@ -68,6 +66,12 @@ function doValidation(db, newDoc, options, callback) { resolve(); } + var isHttp = ["http", "https"].indexOf(db.type()) !== -1; + if (isHttp && !options.checkHttp) { + //CouchDB does the checking for itself. Validate succesful. + resolve(); + return; + } if ((newDoc._id || "").indexOf("_design/") === 0) { //a design document -> always validates succesful. resolve();