Files
pikasTech-unidesk/scripts/src/ssh-output-flush.ts
T
2026-07-17 17:55:45 +02:00

10 lines
278 B
TypeScript

export async function flushWritableStreams(streams: readonly NodeJS.WritableStream[]): Promise<void> {
await Promise.all(streams.map((stream) => new Promise<void>((resolve) => {
try {
stream.write("", () => resolve());
} catch {
resolve();
}
})));
}