Simplify _.isBuffer.

This commit is contained in:
John-David Dalton
2016-06-02 14:48:25 -07:00
parent fcbb63ad60
commit ccd1d6ab29

View File

@@ -1343,6 +1343,7 @@
nativeFloor = Math.floor,
nativeGetPrototype = Object.getPrototypeOf,
nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeIsFinite = context.isFinite,
nativeJoin = arrayProto.join,
nativeKeys = Object.keys,
@@ -10724,9 +10725,7 @@
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = !Buffer ? stubFalse : function(value) {
return value instanceof Buffer;
};
var isBuffer = nativeIsBuffer || stubFalse;
/**
* Checks if `value` is classified as a `Date` object.