isPlainObject

isPlainObject() returns true for plain objects whose prototype is Object.prototype or null.

Signature

function isPlainObject(value: unknown): boolean

Basic usage

import { isPlainObject } from "@fobx/core"

isPlainObject({}) // true
isPlainObject({ a: 1 }) // true
isPlainObject(Object.create(null)) // true
isPlainObject(new Map()) // false
isPlainObject(null) // false

What it excludes

This check excludes arrays, maps, sets, dates, regexps, and class instances.

FobX uses plain-object detection when deciding how to convert values in the observable object and collection APIs.