Skip to content

Commit 281c3e1

Browse files
SourceR85Steven-John Lange
andauthored
Set default opts for CheckpointerInternal (#8871)
* set default opts * force CI run * force CI run * force CI run * force CI run * force CI run * force CI run * add individual fallbacks --------- Co-authored-by: Steven-John Lange <s.lange@hz-deutschland.de>
1 parent 7e15d3b commit 281c3e1

File tree

1 file changed

+13
-2
lines changed
  • packages/node_modules/pouchdb-checkpointer/src

1 file changed

+13
-2
lines changed

packages/node_modules/pouchdb-checkpointer/src/index.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,23 @@ function updateCheckpoint(db, id, checkpoint, session, returnValue) {
7373
}
7474

7575
class CheckpointerInternal {
76-
constructor(src, target, id, returnValue, opts) {
76+
constructor(src, target, id, returnValue, opts = {
77+
writeSourceCheckpoint: true,
78+
writeTargetCheckpoint: true,
79+
}) {
7780
this.src = src;
7881
this.target = target;
7982
this.id = id;
8083
this.returnValue = returnValue;
81-
this.opts = opts || {};
84+
this.opts = opts;
85+
86+
if (typeof opts.writeSourceCheckpoint === "undefined") {
87+
opts.writeSourceCheckpoint = true;
88+
}
89+
90+
if (typeof opts.writeTargetCheckpoint === "undefined") {
91+
opts.writeTargetCheckpoint = true;
92+
}
8293
}
8394

8495
writeCheckpoint(checkpoint, session) {

0 commit comments

Comments
 (0)