MCPcopy
hub / github.com/heroku/react-refetch / isPlainObject

Function isPlainObject

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

Source from the content-addressed store, hash-verified

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

Callers 4

coerceMappingsFunction · 0.85
coerceMappingFunction · 0.85
headersFunction · 0.85

Calls 1

fnToStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…