@gyumeijie/is-pojo

1.0.2 • Public • Published

isPOJO

check whether an object is a Plain Javascript Object

Install

$ npm install @gyumeijie/is-pojo

Usage

const isPlainObject = require('@gyumeijie/is-pojo');

isPlainObject({})  //true
isPlainObject(Object.create(null))  //true
isPlainObject(Object.create(Object.prototype))  //true
isPlainObject({ constructor: function Foo() {} })  //true
isPlainObject(Object.create({}))  //false
isPlainObject('string')  //false
isPlainObject(undefined)  //false
isPlainObject(1)  //false
isPlainObject(() => {})  //false
isPlainObject([])  //false
isPlainObject([1, 2, 3, 4])  //false
isPlainObject(new Date())  //false
isPlainObject(/regexp/)  //false

License

MIT © Gyumeijie

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    3
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i @gyumeijie/is-pojo

Weekly Downloads

5

Version

1.0.2

License

MIT

Unpacked Size

9.89 kB

Total Files

10

Last publish

Collaborators

  • gyumeijie