Skip to content

Commit d9a4623

Browse files
authored
expose textEncoder to the global object (#1)
1 parent 24709bb commit d9a4623

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

util.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,3 +717,10 @@ exports.callbackify = callbackify;
717717
const textEncoding = require('text-encoding-polyfill');
718718
exports.TextEncoder = textEncoding.TextEncoder;
719719
exports.TextDecoder = textEncoding.TextDecoder;
720+
721+
Object.defineProperty(global, 'TextEncoder', {
722+
value: textEncoding.TextEncoder,
723+
writable: true,
724+
enumerable: false,
725+
configurable: true,
726+
});

0 commit comments

Comments
 (0)