MCPcopy Index your code
hub / github.com/google-map-react/google-map-react / isPlainObject

Function isPlainObject

src/utils/isPlainObject.js:8–29  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

6 * @returns {boolean} True if the argument appears to be a plain object.
7 */
8export default function isPlainObject(obj) {
9 if (!obj || typeof obj !== 'object') {
10 return false;
11 }
12
13 const proto =
14 typeof obj.constructor === 'function'
15 ? Object.getPrototypeOf(obj)
16 : Object.prototype;
17
18 if (proto === null) {
19 return true;
20 }
21
22 const constructor = proto.constructor;
23
24 return (
25 typeof constructor === 'function' &&
26 constructor instanceof constructor &&
27 fnToString(constructor) === fnToString(Object)
28 );
29}

Callers 3

latLng2ObjFunction · 0.85
constructorMethod · 0.85
GoogleMapClass · 0.85

Calls 1

fnToStringFunction · 0.85

Tested by

no test coverage detected