You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2018/07/18 13:58:38 UTC

[couchdb-nano] 08/08: jshint fixes

This is an automated email from the ASF dual-hosted git repository.

glynnbird pushed a commit to branch issue98
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git

commit abab8879abcebbee6f22dd87d50831c1dc299442
Author: Glynn Bird <gl...@gmail.com>
AuthorDate: Wed Jul 18 14:58:22 2018 +0100

    jshint fixes
---
 lib/nano.js | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/nano.js b/lib/nano.js
index 1bf2d17..6db083d 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -80,7 +80,7 @@ module.exports = exports = nano = function dbScope(cfg) {
   }
   const responseHandler = function(req, opts, resolve, reject, callback) {
     
-    return function(err, response = { statusCode: 500 }, body) {
+    return function(err, response = { statusCode: 500 }, body = '') {
       let parsed;
       const responseHeaders = Object.assign({
         uri: req.uri,
@@ -422,13 +422,19 @@ module.exports = exports = nano = function dbScope(cfg) {
   // http://guide.couchdb.org/draft/replication.html
   function queryReplication(id, opts0, callback0) {
     const {opts, callback} = getCallback(opts0, callback0);
-    return relax({db: '_replicator', method: 'GET', path: id}, callback);
+    return relax({db: '_replicator', method: 'GET', path: id, qs: opts}, callback);
   }
 
   // http://guide.couchdb.org/draft/replication.html
   function disableReplication(id, rev, opts0, callback0) {
     const {opts, callback} = getCallback(opts0, callback0);
-    return relax({db: '_replicator', method: 'DELETE', path: id, qs: {rev: rev}}, callback);
+    const req = {
+      db: '_replicator', 
+      method: 'DELETE', 
+      path: id, 
+      qs: Object.assign(opts, {rev: rev})
+    };
+    return relax(req, callback);
   }
 
   function docModule(dbName) {
@@ -509,7 +515,7 @@ module.exports = exports = nano = function dbScope(cfg) {
           if (err) {
             reject(err);
           } else {
-            resolve(headers)
+            resolve(headers);
           }
         });
       });