Skip to content

Commit

Permalink
chore: adjusted types
Browse files Browse the repository at this point in the history
  • Loading branch information
caroltrindade committed Apr 11, 2024
1 parent fa3c0ee commit 44979e6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/s3/formatters.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Readable } from 'stream';

export const streamToString = async (stream: Readable | ReadableStream | Blob) => new Promise((resolve, reject) => {
const chunks = []
stream.on('data', chunk => chunks.push(chunk))
export const streamToString = async (stream: Readable) => new Promise((resolve, reject) => {
const chunks: any[] = []

stream.on('data', (chunk: any) => chunks.push(chunk))
stream.on('error', reject)
stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')))
})

0 comments on commit 44979e6

Please sign in to comment.