🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

is-plain-object

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-plain-object

Returns true if an object was created by the `Object` constructor, or Object.create(null).

5.0.0
latest
Source
npm
Version published
Weekly downloads
59M
10.36%
Maintainers
3
Weekly downloads
 
Created

What is is-plain-object?

The is-plain-object package is a simple utility that checks if an object is a plain object, that is, an object created by the Object constructor or one with a null prototype.

What are is-plain-object's main functionalities?

Check if an object is a plain object

This feature allows you to verify if a given object is a plain object. It returns true for objects created by the Object constructor or with a null prototype and false for objects created by other constructors.

const isPlainObject = require('is-plain-object');

const obj = { x: 1, y: 2 };
console.log(isPlainObject(obj)); // true

const notPlain = Object.create(null);
console.log(isPlainObject(notPlain)); // true

function Test() { this.a = 1; }
console.log(isPlainObject(new Test())); // false

Other packages similar to is-plain-object

Keywords

check

FAQs

Package last updated on 09 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts