Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
49M
increased by5.41%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc