Cleanup imports and formatting in bridge
Reorder and tidy imports, re-export types, and apply minor formatting fixes across the bridge package. Changes include: - Reordered imports and grouped related imports in hook-manager, hook-session, pipe-watcher, qq-hook-client, qq-port-probe and others. - Moved several type re-exports (HookProcessBaseInfo, QqPortLoginInfo, HookProcessInfo/Status) in hook-manager and consolidated exports in package entry index.ts. - Minor whitespace/style tweaks: constructor spacing, for-loop formatting, empty catch handlers, and small refactors that do not change runtime behavior. These are non-functional housekeeping changes to improve consistency and readability.
This commit is contained in:
1 parent
a49e507e15
commit
afbec8ed44
7 files changed
+22
-29
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import { promises as fs } from 'fs';
|
||||
import net from 'net';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import { promises as fs } from 'fs';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
export const PIPE_MAGIC = 0x31504851;
|
||||
export const PIPE_VERSION = 1;
|
||||
@@ -235,7 +235,7 @@ function encodeFrame({
|
||||
class FrameReader {
|
||||
private buffer = Buffer.alloc(0);
|
||||
|
||||
constructor(private readonly onFrame: (frame: PipeFrame) => void) {}
|
||||
constructor(private readonly onFrame: (frame: PipeFrame) => void) { }
|
||||
|
||||
push(chunk: Buffer): void {
|
||||
this.buffer = Buffer.concat([this.buffer, chunk]);
|
||||
@@ -513,7 +513,7 @@ export class QqHookClient extends EventEmitter {
|
||||
const workerCount = Math.max(1, Math.min(concurrency | 0, items.length || 1));
|
||||
|
||||
const worker = async () => {
|
||||
for (;;) {
|
||||
for (; ;) {
|
||||
const index = nextIndex;
|
||||
nextIndex += 1;
|
||||
if (index >= items.length) return;
|
||||
@@ -624,7 +624,7 @@ export class QqHookClient extends EventEmitter {
|
||||
else resolve();
|
||||
});
|
||||
}));
|
||||
this.controlWriteChain = writePromise.catch(() => {});
|
||||
this.controlWriteChain = writePromise.catch(() => { });
|
||||
return writePromise;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user