Simplify type checking of plainObject, buffer (#2252)

This commit is contained in:
Mikhail Bodrov 2020-06-10 22:54:01 +03:00 committed by GitHub
parent 17ea70a102
commit 9431029917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}; };
/** /**