mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Add doc note to _.isPlainObject for objects created by Object.create(null). [closes #526] [ci skip]
This commit is contained in:
@@ -6453,7 +6453,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is an object created by the `Object` constructor.
|
* Checks if `value` is an object created by the `Object` constructor or has
|
||||||
|
* a `[[Prototype]]` of `null`.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -6475,6 +6476,9 @@
|
|||||||
*
|
*
|
||||||
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
||||||
* // => true
|
* // => true
|
||||||
|
*
|
||||||
|
* _.isPlainObject(Object.create(null));
|
||||||
|
* // => true
|
||||||
*/
|
*/
|
||||||
var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
|
var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
|
||||||
if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) {
|
if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user