pouchdb-replication-stream
Version:
PouchDB/CouchDB replication as a stream
16 lines (13 loc) • 348 B
JavaScript
;
var through = require('through2').obj;
module.exports = function () {
return through(function (chunk, _, next) {
// this only applies in the browser
/* istanbul ignore next */
if (!(chunk instanceof Buffer) && Buffer.isBuffer(chunk)) {
chunk = new Buffer(chunk);
}
this.push(chunk);
next();
});
};