mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Simplify type checking of plainObject, buffer (#2252)
This commit is contained in:
parent
17ea70a102
commit
9431029917
@ -21,7 +21,7 @@ const object = function (val) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
const plainObject = function (val) {
|
const plainObject = function (val) {
|
||||||
return object(val) && Object.prototype.toString.call(val) === '[object Object]';
|
return Object.prototype.toString.call(val) === '[object Object]';
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,7 +45,7 @@ const bool = function (val) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
const buffer = function (val) {
|
const buffer = function (val) {
|
||||||
return object(val) && val instanceof Buffer;
|
return val instanceof Buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user