mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Simplify _.isBuffer.
This commit is contained in:
@@ -1343,6 +1343,7 @@
|
|||||||
nativeFloor = Math.floor,
|
nativeFloor = Math.floor,
|
||||||
nativeGetPrototype = Object.getPrototypeOf,
|
nativeGetPrototype = Object.getPrototypeOf,
|
||||||
nativeGetSymbols = Object.getOwnPropertySymbols,
|
nativeGetSymbols = Object.getOwnPropertySymbols,
|
||||||
|
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
|
||||||
nativeIsFinite = context.isFinite,
|
nativeIsFinite = context.isFinite,
|
||||||
nativeJoin = arrayProto.join,
|
nativeJoin = arrayProto.join,
|
||||||
nativeKeys = Object.keys,
|
nativeKeys = Object.keys,
|
||||||
@@ -10724,9 +10725,7 @@
|
|||||||
* _.isBuffer(new Uint8Array(2));
|
* _.isBuffer(new Uint8Array(2));
|
||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
var isBuffer = !Buffer ? stubFalse : function(value) {
|
var isBuffer = nativeIsBuffer || stubFalse;
|
||||||
return value instanceof Buffer;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is classified as a `Date` object.
|
* Checks if `value` is classified as a `Date` object.
|
||||||
|
|||||||
Reference in New Issue
Block a user