|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
551 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | function isPlainObject(value) {
|
|---|
| 6 | if (!value || typeof value !== 'object') {
|
|---|
| 7 | return false;
|
|---|
| 8 | }
|
|---|
| 9 | const proto = Object.getPrototypeOf(value);
|
|---|
| 10 | const hasObjectPrototype = proto === null ||
|
|---|
| 11 | proto === Object.prototype ||
|
|---|
| 12 | Object.getPrototypeOf(proto) === null;
|
|---|
| 13 | if (!hasObjectPrototype) {
|
|---|
| 14 | return false;
|
|---|
| 15 | }
|
|---|
| 16 | return Object.prototype.toString.call(value) === '[object Object]';
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | exports.isPlainObject = isPlainObject;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.