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

pouchdb-replication

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-replication - npm Package Compare versions

Comparing version 6.3.4 to 6.4.0

47

lib/index.es.js

@@ -246,2 +246,3 @@ import Promise from 'pouchdb-promise';

var session = uuid();
var seq_interval = opts.seq_interval;

@@ -314,3 +315,5 @@ result = result || {

result.errors.push(error);
if (error.name === 'unauthorized' || error.name === 'forbidden') {
// Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
var errorName = (error.name || '').toLowerCase();
if (errorName === 'unauthorized' || errorName === 'forbidden') {
returnValue.emit('denied', clone(error));

@@ -339,2 +342,8 @@ } else {

outResult.docs = changedDocs;
// Attach 'pending' property if server supports it (CouchDB 2.0+)
/* istanbul ignore if */
if (typeof currentBatch.pending === 'number') {
outResult.pending = currentBatch.pending;
delete currentBatch.pending;
}
returnValue.emit('change', outResult);

@@ -486,3 +495,5 @@ }

if (fatalError.name === 'unauthorized' || fatalError.name === 'forbidden') {
// Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
var errorName = (fatalError.name || '').toLowerCase();
if (errorName === 'unauthorized' || errorName === 'forbidden') {
returnValue.emit('error', fatalError);

@@ -502,3 +513,3 @@ returnValue.removeAllListeners();

function onChange(change) {
function onChange(change, pending, lastSeq) {
/* istanbul ignore if */

@@ -508,2 +519,8 @@ if (returnValue.cancelled) {

}
// Attach 'pending' property if server supports it (CouchDB 2.0+)
/* istanbul ignore if */
if (typeof pending === 'number') {
pendingBatch.pending = pending;
}
var filter = filterChange(opts)(change);

@@ -513,3 +530,3 @@ if (!filter) {

}
pendingBatch.seq = change.seq;
pendingBatch.seq = change.seq || lastSeq;
pendingBatch.changes.push(change);

@@ -626,2 +643,5 @@ processPendingBatch(batches.length === 0 && changesOpts.live);

};
if (seq_interval !== false) {
changesOpts.seq_interval = seq_interval || batch_size;
}
if (opts.filter) {

@@ -998,10 +1018,13 @@ if (typeof opts.filter !== 'string') {

var self = this;
return {
from: function (other, opts, callback) {
return self.constructor.replicate(other, self, opts, callback);
},
to: function (other, opts, callback) {
return self.constructor.replicate(self, other, opts, callback);
}
};
if (typeof this.replicateMethods === 'undefined') {
this.replicateMethods = {
from: function (other, opts, callback) {
return self.constructor.replicate(other, self, opts, callback);
},
to: function (other, opts, callback) {
return self.constructor.replicate(self, other, opts, callback);
}
};
}
return this.replicateMethods;
}

@@ -1008,0 +1031,0 @@ });

@@ -250,2 +250,3 @@ 'use strict';

var session = pouchdbUtils.uuid();
var seq_interval = opts.seq_interval;

@@ -318,3 +319,5 @@ result = result || {

result.errors.push(error);
if (error.name === 'unauthorized' || error.name === 'forbidden') {
// Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
var errorName = (error.name || '').toLowerCase();
if (errorName === 'unauthorized' || errorName === 'forbidden') {
returnValue.emit('denied', pouchdbUtils.clone(error));

@@ -343,2 +346,8 @@ } else {

outResult.docs = changedDocs;
// Attach 'pending' property if server supports it (CouchDB 2.0+)
/* istanbul ignore if */
if (typeof currentBatch.pending === 'number') {
outResult.pending = currentBatch.pending;
delete currentBatch.pending;
}
returnValue.emit('change', outResult);

@@ -490,3 +499,5 @@ }

if (fatalError.name === 'unauthorized' || fatalError.name === 'forbidden') {
// Normalize error name. i.e. 'Unauthorized' -> 'unauthorized' (eg Sync Gateway)
var errorName = (fatalError.name || '').toLowerCase();
if (errorName === 'unauthorized' || errorName === 'forbidden') {
returnValue.emit('error', fatalError);

@@ -506,3 +517,3 @@ returnValue.removeAllListeners();

function onChange(change) {
function onChange(change, pending, lastSeq) {
/* istanbul ignore if */

@@ -512,2 +523,8 @@ if (returnValue.cancelled) {

}
// Attach 'pending' property if server supports it (CouchDB 2.0+)
/* istanbul ignore if */
if (typeof pending === 'number') {
pendingBatch.pending = pending;
}
var filter = pouchdbUtils.filterChange(opts)(change);

@@ -517,3 +534,3 @@ if (!filter) {

}
pendingBatch.seq = change.seq;
pendingBatch.seq = change.seq || lastSeq;
pendingBatch.changes.push(change);

@@ -630,2 +647,5 @@ processPendingBatch(batches.length === 0 && changesOpts.live);

};
if (seq_interval !== false) {
changesOpts.seq_interval = seq_interval || batch_size;
}
if (opts.filter) {

@@ -1002,10 +1022,13 @@ if (typeof opts.filter !== 'string') {

var self = this;
return {
from: function (other, opts, callback) {
return self.constructor.replicate(other, self, opts, callback);
},
to: function (other, opts, callback) {
return self.constructor.replicate(self, other, opts, callback);
}
};
if (typeof this.replicateMethods === 'undefined') {
this.replicateMethods = {
from: function (other, opts, callback) {
return self.constructor.replicate(other, self, opts, callback);
},
to: function (other, opts, callback) {
return self.constructor.replicate(self, other, opts, callback);
}
};
}
return this.replicateMethods;
}

@@ -1012,0 +1035,0 @@ });

{
"name": "pouchdb-replication",
"version": "6.3.4",
"version": "6.4.0",
"description": "PouchDB's replication and sync algorithm, as a plugin.",

@@ -13,7 +13,7 @@ "main": "./lib/index.js",

"inherits": "2.0.3",
"pouchdb-checkpointer": "6.3.4",
"pouchdb-errors": "6.3.4",
"pouchdb-generate-replication-id": "6.3.4",
"pouchdb-promise": "6.3.4",
"pouchdb-utils": "6.3.4"
"pouchdb-checkpointer": "6.4.0",
"pouchdb-errors": "6.4.0",
"pouchdb-generate-replication-id": "6.4.0",
"pouchdb-promise": "6.4.0",
"pouchdb-utils": "6.4.0"
},

@@ -20,0 +20,0 @@ "module": "./lib/index.es.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