Be more one liner

This commit is contained in:
Daniel García Aubert 2018-06-14 00:54:03 +02:00
parent 9c8d802f75
commit 8eab164e4e

View File

@ -19,12 +19,8 @@ module.exports = class StreamCopy {
const pgstream = client.query(copyToStream);
pgstream
.on('error', err => {
done(err);
})
.on('end', () => {
done();
});
.on('end', () => done())
.on('error', err => done(err));
cb(null, pgstream, copyToStream, client, done);
});
@ -40,12 +36,8 @@ module.exports = class StreamCopy {
const pgstream = client.query(copyFromStream);
pgstream
.on('error', err => {
done(err);
})
.on('end', () => {
done();
});
.on('end', () => done())
.on('error', err => done(err));
cb(null, pgstream, copyFromStream, client, done);
});