We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65dd10e commit 898d423Copy full SHA for 898d423
lib/string_decoder.js
@@ -1,9 +1,9 @@
1
'use strict';
2
3
-const isEncoding = Buffer.isEncoding;
4
-
5
function assertEncoding(encoding) {
6
- if (encoding && !isEncoding(encoding)) {
+ // Do not cache `Buffer.isEncoding`, some modules monkey-patch it to support
+ // additional encodings
+ if (encoding && !Buffer.isEncoding(encoding)) {
7
throw new Error('Unknown encoding: ' + encoding);
8
}
9
0 commit comments