mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Bump to v4.16.5.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
var getPrototype = require('./_getPrototype'),
|
||||
var baseGetTag = require('./_baseGetTag'),
|
||||
getPrototype = require('./_getPrototype'),
|
||||
isObjectLike = require('./isObjectLike');
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
@@ -17,13 +18,6 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
/** Used to infer the `Object` constructor. */
|
||||
var objectCtorString = funcToString.call(Object);
|
||||
|
||||
/**
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objectToString = objectProto.toString;
|
||||
|
||||
/**
|
||||
* Checks if `value` is a plain object, that is, an object created by the
|
||||
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
||||
@@ -53,7 +47,7 @@ var objectToString = objectProto.toString;
|
||||
* // => true
|
||||
*/
|
||||
function isPlainObject(value) {
|
||||
if (!isObjectLike(value) || objectToString.call(value) != objectTag) {
|
||||
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
||||
return false;
|
||||
}
|
||||
var proto = getPrototype(value);
|
||||
@@ -61,8 +55,8 @@ function isPlainObject(value) {
|
||||
return true;
|
||||
}
|
||||
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
||||
return (typeof Ctor == 'function' &&
|
||||
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
|
||||
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
||||
funcToString.call(Ctor) == objectCtorString;
|
||||
}
|
||||
|
||||
module.exports = isPlainObject;
|
||||
|
||||
Reference in New Issue
Block a user