🐛 Do not reuse TextDecoder for multiple stream decodes

This commit is contained in:
C-3PO 2018-07-05 13:24:47 +02:00
parent 66d14a1d5b
commit 7dfe0176ab
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -1,9 +1,9 @@
import * as stream from 'stream';
import { TextDecoder } from 'util';
export default function streamToString(inputStream: stream.Readable): Promise<string> {
const decoder = new TextDecoder('utf-8');
export default function streamToString(inputStream: stream.Readable): Promise<string> {
return new Promise((resolve, reject) => {
const stringParts: string[] = [];