2.0.3 • Published 10 months ago

@pacote/is-plain-object v2.0.3

Weekly downloads
232
License
MIT
Repository
-
Last release
10 months ago

@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.

2.0.3

10 months ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago