@pacote/is-plain-object
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

@pacote/is-plain-object

version minified minified + gzip

Checks whether the provided value is a plain JavaScript object.

Installation

yarn add @pacote/is-plain-object

Usage

import { isPlainObject } from '@pacote/is-plain-object'

// These return true:
isPlainObject({})
isPlainObject({ an: 'object' })

// All of these return false:
isPlainObject(undefined)
isPlainObject(null)
isPlainObject(false)
isPlainObject(true)
isPlainObject(NaN)
isPlainObject(Infinity)
isPlainObject(0)
isPlainObject('string')
isPlainObject([])
isPlainObject(new ArrayBuffer(0))
isPlainObject(new Date())
isPlainObject(new Map())
isPlainObject(new Promise())
isPlainObject(new Set())
isPlainObject(new WeakMap())
isPlainObject(new WeakSet())

isPlainObject(o: any): boolean

isPlainObject() takes a single value and checks whether it is a plain object. May be used as a type guard.

License

MIT © Luís Rodrigues.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.319latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.319
2.0.27
2.0.11
2.0.00
1.2.181
1.2.06
1.1.61
1.1.51
1.1.40
1.1.31
1.1.20
1.1.10
1.1.00
1.0.70
1.0.61
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @pacote/is-plain-object

Weekly Downloads

118

Version

2.0.3

License

MIT

Unpacked Size

12.8 kB

Total Files

13

Last publish

Collaborators

  • goblindegook