Commit b9e5e632 authored by Julien Fontanet's avatar Julien Fontanet

chore: fix coding style

parent 1049c269
...@@ -11,7 +11,7 @@ module.exports = function createReadStream(path, options, cb) { ...@@ -11,7 +11,7 @@ module.exports = function createReadStream(path, options, cb) {
cb = options; cb = options;
options = {}; options = {};
} else if (options == null) { } else if (options == null) {
options = {} options = {};
} }
var connection = this; var connection = this;
...@@ -24,11 +24,11 @@ module.exports = function createReadStream(path, options, cb) { ...@@ -24,11 +24,11 @@ module.exports = function createReadStream(path, options, cb) {
var offset = new BigInt(file.EndofFile.length, options.start || 0); var offset = new BigInt(file.EndofFile.length, options.start || 0);
var fileSize = BigInt.fromBuffer(file.EndofFile); var fileSize = BigInt.fromBuffer(file.EndofFile);
var end = options.end var end = options.end;
if (end != null) { if (end != null) {
end = new BigInt(8, end + 1) end = new BigInt(8, end + 1);
if (end.gt(fileSize)) { if (end.gt(fileSize)) {
fileSize = end fileSize = end;
} }
} }
...@@ -50,9 +50,9 @@ module.exports = function createReadStream(path, options, cb) { ...@@ -50,9 +50,9 @@ module.exports = function createReadStream(path, options, cb) {
} }
if (offset.ge(fileSize)) { if (offset.ge(fileSize)) {
return close(function () { return close(function() {
this.push(null) this.push(null);
}) });
} }
running = true; running = true;
......
...@@ -40,7 +40,7 @@ module.exports = function createWriteStream(path, options, cb) { ...@@ -40,7 +40,7 @@ module.exports = function createWriteStream(path, options, cb) {
function write(buffer, i, cb) { function write(buffer, i, cb) {
var j = i + maxPacketSize; var j = i + maxPacketSize;
var chunk = buffer.slice(i, j) var chunk = buffer.slice(i, j);
request( request(
'write', 'write',
{ {
...@@ -53,7 +53,7 @@ module.exports = function createWriteStream(path, options, cb) { ...@@ -53,7 +53,7 @@ module.exports = function createWriteStream(path, options, cb) {
if (err != null) { if (err != null) {
return cb(err); return cb(err);
} }
offset = offset.add(chunk.length) offset = offset.add(chunk.length);
if (j < buffer.length) { if (j < buffer.length) {
return write(buffer, j, cb); return write(buffer, j, cb);
} }
...@@ -71,7 +71,7 @@ module.exports = function createWriteStream(path, options, cb) { ...@@ -71,7 +71,7 @@ module.exports = function createWriteStream(path, options, cb) {
cb(err); cb(err);
}); });
}; };
stream._final = close stream._final = close;
stream._write = function(chunk, encoding, next) { stream._write = function(chunk, encoding, next) {
write( write(
Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding), Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding),
......
var constants = require('../structures/constants') var constants = require('../structures/constants');
module.exports = { module.exports = {
request: [ request: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment