Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return generateReplicationId(src, target, opts).then(function (res) {
repId = res;
var checkpointOpts = {};
if (opts.checkpoint === false) {
checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: false };
} else if (opts.checkpoint === 'source') {
checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: false };
} else if (opts.checkpoint === 'target') {
checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: true };
} else {
checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: true };
}
checkpointer = new Checkpointer(src, target, repId, returnValue, checkpointOpts);
});
}