Files
twenty/packages/twenty-server/src/utils/stream-to-buffer.ts
T
Félix MalfaitandGitHub 8b4b9ef8da Change type import rule (#13751)
Forcing "type" to be explicit, works best will rollup on the frontend to
exclude depdendencies
2025-08-08 01:27:05 +02:00

13 lines
314 B
TypeScript

import { type Readable } from 'stream';
export const streamToBuffer = async (stream: Readable): Promise<Buffer> => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const chunks: any[] = [];
for await (const chunk of stream) {
chunks.push(chunk);
}
return Buffer.concat(chunks);
};