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 f8249bb commit c5aa244Copy full SHA for c5aa244
lib/buffer.js
@@ -427,7 +427,7 @@ Buffer.compare = function compare(a, b) {
427
428
429
Buffer.isEncoding = function isEncoding(encoding) {
430
- return typeof encoding === 'string' &&
+ return typeof encoding === 'string' && encoding.length !== 0 &&
431
normalizeEncoding(encoding) !== undefined;
432
};
433
Buffer[kIsEncodingSymbol] = Buffer.isEncoding;
0 commit comments