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

pouchdb-checkpointer

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

Comparing version 6.2.0 to 6.2.1-prerelease

src/index.js

37

lib/index.es.js

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

function Checkpointer(src, target, id, returnValue) {
function Checkpointer(src, target, id, returnValue, opts) {
this.src = src;

@@ -82,2 +82,3 @@ this.target = target;

this.returnValue = returnValue;
this.opts = opts;
}

@@ -93,20 +94,28 @@

Checkpointer.prototype.updateTarget = function (checkpoint, session) {
return updateCheckpoint(this.target, this.id, checkpoint,
session, this.returnValue);
if (this.opts.writeTargetCheckpoint) {
return updateCheckpoint(this.target, this.id, checkpoint,
session, this.returnValue);
} else {
return Promise.resolve(true);
}
};
Checkpointer.prototype.updateSource = function (checkpoint, session) {
var self = this;
if (this.readOnlySource) {
if (this.opts.writeSourceCheckpoint) {
var self = this;
if (this.readOnlySource) {
return Promise.resolve(true);
}
return updateCheckpoint(this.src, this.id, checkpoint,
session, this.returnValue)
.catch(function (err) {
if (isForbiddenError(err)) {
self.readOnlySource = true;
return true;
}
throw err;
});
} else {
return Promise.resolve(true);
}
return updateCheckpoint(this.src, this.id, checkpoint,
session, this.returnValue)
.catch(function (err) {
if (isForbiddenError(err)) {
self.readOnlySource = true;
return true;
}
throw err;
});
};

@@ -113,0 +122,0 @@

@@ -80,3 +80,3 @@ 'use strict';

function Checkpointer(src, target, id, returnValue) {
function Checkpointer(src, target, id, returnValue, opts) {
this.src = src;

@@ -86,2 +86,3 @@ this.target = target;

this.returnValue = returnValue;
this.opts = opts;
}

@@ -97,20 +98,28 @@

Checkpointer.prototype.updateTarget = function (checkpoint, session) {
return updateCheckpoint(this.target, this.id, checkpoint,
session, this.returnValue);
if (this.opts.writeTargetCheckpoint) {
return updateCheckpoint(this.target, this.id, checkpoint,
session, this.returnValue);
} else {
return Promise.resolve(true);
}
};
Checkpointer.prototype.updateSource = function (checkpoint, session) {
var self = this;
if (this.readOnlySource) {
if (this.opts.writeSourceCheckpoint) {
var self = this;
if (this.readOnlySource) {
return Promise.resolve(true);
}
return updateCheckpoint(this.src, this.id, checkpoint,
session, this.returnValue)
.catch(function (err) {
if (isForbiddenError(err)) {
self.readOnlySource = true;
return true;
}
throw err;
});
} else {
return Promise.resolve(true);
}
return updateCheckpoint(this.src, this.id, checkpoint,
session, this.returnValue)
.catch(function (err) {
if (isForbiddenError(err)) {
self.readOnlySource = true;
return true;
}
throw err;
});
};

@@ -117,0 +126,0 @@

{
"name": "pouchdb-checkpointer",
"version": "6.2.0",
"version": "6.2.1-prerelease",
"description": "PouchDB tool to write a checkpoint, e.g. during replication.",

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

"repository": "https://github.com/pouchdb/pouchdb",
"jsnext:main": "./lib/index.es.js",
"dependencies": {
"pouchdb-collate": "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