We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
globalThis.TextEncoder
1 parent 7139ce9 commit df956d1Copy full SHA for df956d1
lib/helpers/formDataToStream.js
@@ -1,11 +1,11 @@
1
-import {TextEncoder} from 'util';
+import util from 'util';
2
import {Readable} from 'stream';
3
import utils from "../utils.js";
4
import readBlob from "./readBlob.js";
5
6
const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';
7
8
-const textEncoder = new TextEncoder();
+const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder();
9
10
const CRLF = '\r\n';
11
const CRLF_BYTES = textEncoder.encode(CRLF);
0 commit comments