1 | import isObjectLike from './is-object-like';
|
2 | import isType from './is-type';
|
3 | var isPlainObject = function (value) {
|
4 | |
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | if (!isObjectLike(value) || !isType(value, 'Object')) {
|
11 | return false;
|
12 | }
|
13 | if (Object.getPrototypeOf(value) === null) {
|
14 | return true;
|
15 | }
|
16 | var proto = value;
|
17 | while (Object.getPrototypeOf(proto) !== null) {
|
18 | proto = Object.getPrototypeOf(proto);
|
19 | }
|
20 | return Object.getPrototypeOf(value) === proto;
|
21 | };
|
22 | export default isPlainObject;
|
23 |
|
\ | No newline at end of file |