mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore: make ESLint Happy
This commit is contained in:
@@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user