Skip to content

Commit 503dd95

Browse files
committed
Add TextEncoder/TextDecoder properties to exports. Implemented with 'text-encoding-polyfill' package, as it fits the node API the closest, e.g. with 'fatal' option.
1 parent a292d8a commit 503dd95

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"is-generator-function": "^1.0.7",
1616
"is-typed-array": "^1.1.3",
1717
"safe-buffer": "^5.1.2",
18+
"text-encoding-polyfill": "^0.6.7",
1819
"which-typed-array": "^1.1.2"
1920
},
2021
"devDependencies": {

util.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,3 +713,7 @@ function callbackify(original) {
713713
return callbackified;
714714
}
715715
exports.callbackify = callbackify;
716+
717+
const textEncoding = require('text-encoding-polyfill');
718+
exports.TextEncoder = textEncoding.TextEncoder;
719+
exports.TextDecoder = textEncoding.TextDecoder;

0 commit comments

Comments
 (0)