constness
This commit is contained in:
@@ -519,7 +519,7 @@ async function clone(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.app, 'object');
|
||||
|
||||
var data = req.body;
|
||||
const data = req.body;
|
||||
|
||||
if (typeof data.backupId !== 'string') return next(new HttpError(400, 'backupId must be a string'));
|
||||
if (typeof data.subdomain !== 'string') return next(new HttpError(400, 'subdomain is required'));
|
||||
@@ -644,7 +644,7 @@ async function getLogStream(req, res, next) {
|
||||
res.write('retry: 3000\n');
|
||||
res.on('close', logStream.close);
|
||||
logStream.on('data', function (data) {
|
||||
var obj = JSON.parse(data);
|
||||
const obj = JSON.parse(data);
|
||||
res.write(sse(obj.realtimeTimestamp, JSON.stringify(obj))); // send timestamp as id
|
||||
});
|
||||
logStream.on('end', res.end.bind(res));
|
||||
@@ -676,19 +676,19 @@ async function getLogs(req, res, next) {
|
||||
}
|
||||
|
||||
function demuxStream(stream, stdin) {
|
||||
var header = null;
|
||||
let header = null;
|
||||
|
||||
stream.on('readable', function() {
|
||||
header = header || stream.read(4);
|
||||
|
||||
while (header !== null) {
|
||||
var length = header.readUInt32BE(0);
|
||||
const length = header.readUInt32BE(0);
|
||||
if (length === 0) {
|
||||
header = null;
|
||||
return stdin.end(); // EOF
|
||||
}
|
||||
|
||||
var payload = stream.read(length);
|
||||
const payload = stream.read(length);
|
||||
|
||||
if (payload === null) break;
|
||||
stdin.write(payload);
|
||||
|
||||
Reference in New Issue
Block a user