Chore: make ESLint Happy

This commit is contained in:
SukkaW
2024-10-10 21:40:54 +08:00
parent 40cda6997a
commit e40979e50e
31 changed files with 228 additions and 220 deletions

View File

@@ -1,9 +1,9 @@
import type { Writable } from 'node:stream';
import { once } from 'node:events';
export const asyncWriteToStream = <T>(stream: Writable, chunk: T) => {
export function asyncWriteToStream<T>(stream: Writable, chunk: T) {
const res = stream.write(chunk);
if (!res) {
return once(stream, 'drain'); // returns a promise only if needed
}
};
}