style: lint

This commit is contained in:
手瓜一十雪
2024-10-25 18:09:41 +08:00
parent dac6709f27
commit 63f746c237
15 changed files with 118 additions and 118 deletions

View File

@@ -167,7 +167,7 @@ export class PacketHighwaySession {
});
await this.packetHighwayClient.upload(
1004,
fs.createReadStream(img.path, {highWaterMark: BlockSize}),
fs.createReadStream(img.path, { highWaterMark: BlockSize }),
img.size,
md5,
extend
@@ -207,7 +207,7 @@ export class PacketHighwaySession {
});
await this.packetHighwayClient.upload(
1003,
fs.createReadStream(img.path, {highWaterMark: BlockSize}),
fs.createReadStream(img.path, { highWaterMark: BlockSize }),
img.size,
md5,
extend
@@ -244,10 +244,10 @@ export class PacketHighwaySession {
hash: {
fileSha1: await calculateSha1StreamBytes(video.filePath!)
}
})
});
await this.packetHighwayClient.upload(
1005,
fs.createReadStream(video.filePath!, {highWaterMark: BlockSize}),
fs.createReadStream(video.filePath!, { highWaterMark: BlockSize }),
+video.fileSize!,
md5,
extend
@@ -275,7 +275,7 @@ export class PacketHighwaySession {
});
await this.packetHighwayClient.upload(
1006,
fs.createReadStream(video.thumbPath!, {highWaterMark: BlockSize}),
fs.createReadStream(video.thumbPath!, { highWaterMark: BlockSize }),
+video.thumbSize!,
md5,
extend
@@ -312,10 +312,10 @@ export class PacketHighwaySession {
hash: {
fileSha1: await calculateSha1StreamBytes(video.filePath!)
}
})
});
await this.packetHighwayClient.upload(
1001,
fs.createReadStream(video.filePath!, {highWaterMark: BlockSize}),
fs.createReadStream(video.filePath!, { highWaterMark: BlockSize }),
+video.fileSize!,
md5,
extend
@@ -343,7 +343,7 @@ export class PacketHighwaySession {
});
await this.packetHighwayClient.upload(
1002,
fs.createReadStream(video.thumbPath!, {highWaterMark: BlockSize}),
fs.createReadStream(video.thumbPath!, { highWaterMark: BlockSize }),
+video.thumbSize!,
md5,
extend
@@ -379,10 +379,10 @@ export class PacketHighwaySession {
hash: {
fileSha1: [sha1]
}
})
});
await this.packetHighwayClient.upload(
1008,
fs.createReadStream(ptt.filePath, {highWaterMark: BlockSize}),
fs.createReadStream(ptt.filePath, { highWaterMark: BlockSize }),
ptt.fileSize,
md5,
extend
@@ -418,10 +418,10 @@ export class PacketHighwaySession {
hash: {
fileSha1: [sha1]
}
})
});
await this.packetHighwayClient.upload(
1007,
fs.createReadStream(ptt.filePath, {highWaterMark: BlockSize}),
fs.createReadStream(ptt.filePath, { highWaterMark: BlockSize }),
ptt.fileSize,
md5,
extend
@@ -484,10 +484,10 @@ export class PacketHighwaySession {
}
},
unknown200: 0,
})
});
await this.packetHighwayClient.upload(
71,
fs.createReadStream(file.filePath, {highWaterMark: BlockSize}),
fs.createReadStream(file.filePath, { highWaterMark: BlockSize }),
file.fileSize,
file.fileMd5,
ext
@@ -549,10 +549,10 @@ export class PacketHighwaySession {
},
unknown200: 1,
unknown3: 0
})
});
await this.packetHighwayClient.upload(
95,
fs.createReadStream(file.filePath, {highWaterMark: BlockSize}),
fs.createReadStream(file.filePath, { highWaterMark: BlockSize }),
file.fileSize,
file.fileMd5,
ext

View File

@@ -30,7 +30,7 @@ abstract class HighwayUploader {
reject(new Error(`[Highway] timeout after ${this.trans.timeout}s`));
}, (this.trans.timeout ?? Infinity) * 1000
);
})
});
}
buildPicUpHead(offset: number, bodyLength: number, bodyMd5: Uint8Array): Uint8Array {
@@ -100,7 +100,7 @@ export class HighwayTcpUploader extends HighwayUploader {
const upload = new Promise<void>((resolve, reject) => {
const highwayTransForm = new HighwayTcpUploaderTransform(this);
const socket = net.connect(this.trans.port, this.trans.server, () => {
this.trans.data.pipe(highwayTransForm).pipe(socket, {end: false});
this.trans.data.pipe(highwayTransForm).pipe(socket, { end: false });
});
const handleRspHeader = (header: Buffer) => {
const rsp = new NapProtoMsg(RespDataHighwayHead).decode(header);
@@ -159,7 +159,7 @@ export class HighwayHttpUploader extends HighwayUploader {
try {
await this.uploadBlock(block, offset);
} catch (err) {
throw new Error(`[Highway] httpUpload Error uploading block at offset ${offset}: ${err}`)
throw new Error(`[Highway] httpUpload Error uploading block at offset ${offset}: ${err}`);
}
offset += block.length;
}