Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pouchdb-adapter-http

Package Overview
Dependencies
Maintainers
5
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pouchdb-adapter-http - npm Package Compare versions

Comparing version 6.2.0 to 6.2.1-prerelease

src/index.js

39

lib/index.es.js

@@ -62,2 +62,4 @@ import Promise from 'pouchdb-promise';

var MAX_SIMULTANEOUS_REVS = 50;
var CHANGES_TIMEOUT_BUFFER = 5000;
var DEFAULT_HEARTBEAT = 10000;

@@ -535,3 +537,6 @@ var supportsBulkGetMap = {};

});
}).catch(callback);
}).catch(function (e) {
e.docId = id;
callback(e);
});
});

@@ -694,2 +699,3 @@

if (err) {
err.docId = doc && doc._id;
return callback(err);

@@ -798,9 +804,27 @@ }

opts = clone(opts);
opts.timeout = ('timeout' in opts) ? opts.timeout :
if (opts.continuous && !('heartbeat' in opts)) {
opts.heartbeat = DEFAULT_HEARTBEAT;
}
var requestTimeout = ('timeout' in opts) ? opts.timeout :
('timeout' in ajaxOpts) ? ajaxOpts.timeout :
30 * 1000;
// We give a 5 second buffer for CouchDB changes to respond with
// an ok timeout (if a timeout it set)
var params = opts.timeout ? {timeout: opts.timeout - (5 * 1000)} : {};
// ensure CHANGES_TIMEOUT_BUFFER applies
if ('timeout' in opts && opts.timeout &&
(requestTimeout - opts.timeout) < CHANGES_TIMEOUT_BUFFER) {
requestTimeout = opts.timeout + CHANGES_TIMEOUT_BUFFER;
}
if ('heartbeat' in opts && opts.heartbeat &&
(requestTimeout - opts.heartbeat) < CHANGES_TIMEOUT_BUFFER) {
requestTimeout = opts.heartbeat + CHANGES_TIMEOUT_BUFFER;
}
var params = {};
if ('timeout' in opts && opts.timeout) {
params.timeout = opts.timeout;
}
var limit = (typeof opts.limit !== 'undefined') ? opts.limit : false;

@@ -848,5 +872,2 @@ var returnDocs;

}
} else if (opts.continuous) {
// Default heartbeat to 10 seconds
params.heartbeat = 10000;
}

@@ -921,3 +942,3 @@

url: genDBUrl(host, '_changes' + paramsToStr(params)),
timeout: opts.timeout,
timeout: requestTimeout,
body: body

@@ -924,0 +945,0 @@ };

@@ -66,2 +66,4 @@ 'use strict';

var MAX_SIMULTANEOUS_REVS = 50;
var CHANGES_TIMEOUT_BUFFER = 5000;
var DEFAULT_HEARTBEAT = 10000;

@@ -539,3 +541,6 @@ var supportsBulkGetMap = {};

});
}).catch(callback);
}).catch(function (e) {
e.docId = id;
callback(e);
});
});

@@ -698,2 +703,3 @@

if (err) {
err.docId = doc && doc._id;
return callback(err);

@@ -802,9 +808,27 @@ }

opts = pouchdbUtils.clone(opts);
opts.timeout = ('timeout' in opts) ? opts.timeout :
if (opts.continuous && !('heartbeat' in opts)) {
opts.heartbeat = DEFAULT_HEARTBEAT;
}
var requestTimeout = ('timeout' in opts) ? opts.timeout :
('timeout' in ajaxOpts) ? ajaxOpts.timeout :
30 * 1000;
// We give a 5 second buffer for CouchDB changes to respond with
// an ok timeout (if a timeout it set)
var params = opts.timeout ? {timeout: opts.timeout - (5 * 1000)} : {};
// ensure CHANGES_TIMEOUT_BUFFER applies
if ('timeout' in opts && opts.timeout &&
(requestTimeout - opts.timeout) < CHANGES_TIMEOUT_BUFFER) {
requestTimeout = opts.timeout + CHANGES_TIMEOUT_BUFFER;
}
if ('heartbeat' in opts && opts.heartbeat &&
(requestTimeout - opts.heartbeat) < CHANGES_TIMEOUT_BUFFER) {
requestTimeout = opts.heartbeat + CHANGES_TIMEOUT_BUFFER;
}
var params = {};
if ('timeout' in opts && opts.timeout) {
params.timeout = opts.timeout;
}
var limit = (typeof opts.limit !== 'undefined') ? opts.limit : false;

@@ -852,5 +876,2 @@ var returnDocs;

}
} else if (opts.continuous) {
// Default heartbeat to 10 seconds
params.heartbeat = 10000;
}

@@ -925,3 +946,3 @@

url: genDBUrl(host, '_changes' + paramsToStr(params)),
timeout: opts.timeout,
timeout: requestTimeout,
body: body

@@ -928,0 +949,0 @@ };

{
"name": "pouchdb-adapter-http",
"version": "6.2.0",
"version": "6.2.1-prerelease",
"description": "PouchDB adapter using HTTP (e.g. a remote CouchDB) as its data store.",

@@ -10,16 +10,3 @@ "main": "./lib/index.js",

"repository": "https://github.com/pouchdb/pouchdb",
"jsnext:main": "./lib/index.es.js",
"dependencies": {
"argsarray": "0.0.1",
"pouchdb-ajax": "6.2.0",
"pouchdb-binary-utils": "6.2.0",
"pouchdb-errors": "6.2.0",
"pouchdb-promise": "6.2.0",
"pouchdb-utils": "6.2.0"
},
"files": [
"lib",
"dist",
"tonic-example.js"
]
"jsnext:main": "./src/index.js"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc