🐛 Do not reuse TextDecoder for multiple stream decodes
This commit is contained in:
parent
66d14a1d5b
commit
7dfe0176ab
1 changed files with 2 additions and 2 deletions
|
@ -1,9 +1,9 @@
|
||||||
import * as stream from 'stream';
|
import * as stream from 'stream';
|
||||||
import { TextDecoder } from 'util';
|
import { TextDecoder } from 'util';
|
||||||
|
|
||||||
const decoder = new TextDecoder('utf-8');
|
|
||||||
|
|
||||||
export default function streamToString(inputStream: stream.Readable): Promise<string> {
|
export default function streamToString(inputStream: stream.Readable): Promise<string> {
|
||||||
|
const decoder = new TextDecoder('utf-8');
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const stringParts: string[] = [];
|
const stringParts: string[] = [];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue