From: Feross Aboukhadijeh Date: Thu, 17 Jul 2014 05:25:56 +0000 (-0700) Subject: simplify Buffer.isBuffer check X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=dc066c8a9fa42752292d47a55244695935a3f939;p=buffer.git simplify Buffer.isBuffer check --- diff --git a/index.js b/index.js index 9526e88..b3e3d41 100644 --- a/index.js +++ b/index.js @@ -126,7 +126,7 @@ Buffer.isEncoding = function (encoding) { } Buffer.isBuffer = function (b) { - return !!(b !== null && b !== undefined && b._isBuffer) + return !!(b != null && b._isBuffer) } Buffer.byteLength = function (str, encoding) {