Value to check.
true when the value is a plain object.
import { isPlainObject } from '@pacote/is-plain-object'
isPlainObject({ answer: 42 }) // => true
isPlainObject({ an: 'object' }) // => true
isPlainObject({}) // => true
isPlainObject(undefined) // => false
isPlainObject(null) // => false
isPlainObject(false) // => false
isPlainObject(true) // => false
isPlainObject(NaN) // => false
isPlainObject(Infinity) // => false
isPlainObject(0) // => false
isPlainObject('string') // => false
isPlainObject([]) // => false
isPlainObject(new ArrayBuffer(0)) // => false
isPlainObject(new Date()) // => false
isPlainObject(new Map()) // => false
isPlainObject(Promise.resolve()) // => false
isPlainObject(new Set()) // => false
isPlainObject(new WeakMap()) // => false
isPlainObject(new WeakSet()) // => false
Checks whether a value is a plain JavaScript object.
Returns
falsefor arrays, built-in objects, typed arrays, and primitive values. This function narrows the value to a string-keyed record.