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) {
cb = options;
options = {};
} else if (options == null) {
options = {}
options = {};
}
var connection = this;
......@@ -24,11 +24,11 @@ module.exports = function createReadStream(path, options, cb) {
var offset = new BigInt(file.EndofFile.length, options.start || 0);
var fileSize = BigInt.fromBuffer(file.EndofFile);
var end = options.end
var end = options.end;
if (end != null) {
end = new BigInt(8, end + 1)
end = new BigInt(8, end + 1);
if (end.gt(fileSize)) {
fileSize = end
fileSize = end;
}
}
......@@ -50,9 +50,9 @@ module.exports = function createReadStream(path, options, cb) {
}
if (offset.ge(fileSize)) {
return close(function () {
this.push(null)
})
return close(function() {
this.push(null);
});
}
running = true;
......
......@@ -40,7 +40,7 @@ module.exports = function createWriteStream(path, options, cb) {
function write(buffer, i, cb) {
var j = i + maxPacketSize;
var chunk = buffer.slice(i, j)
var chunk = buffer.slice(i, j);
request(
'write',
{
......@@ -53,7 +53,7 @@ module.exports = function createWriteStream(path, options, cb) {
if (err != null) {
return cb(err);
}
offset = offset.add(chunk.length)
offset = offset.add(chunk.length);
if (j < buffer.length) {
return write(buffer, j, cb);
}
......@@ -71,7 +71,7 @@ module.exports = function createWriteStream(path, options, cb) {
cb(err);
});
};
stream._final = close
stream._final = close;
stream._write = function(chunk, encoding, next) {
write(
Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding),
......
var constants = require('../structures/constants')
var constants = require('../structures/constants');
module.exports = {
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