Socket
Socket
Sign inDemoInstall

is-obj

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

is-obj

Check if a value is an object

    3.0.0latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
21,562,170
increased by4.32%

Weekly downloads

Package description

What is is-obj?

The is-obj package is a simple utility that allows you to check if a value is a non-null object. It is useful when you want to ensure that a value is an object type (excluding null, arrays, and other non-plain objects) before performing operations that are specific to objects.

What are is-obj's main functionalities?

Check if a value is a non-null object

This feature allows you to verify if a given value is a non-null object. It returns true for plain objects and false for null, arrays, functions, and other non-object types.

const isObj = require('is-obj');

console.log(isObj({})); // true
console.log(isObj(null)); // false
console.log(isObj([])); // false
console.log(isObj('hello')); // false

Other packages similar to is-obj

Readme

Source

is-obj

Check if a value is an object

Keep in mind that array, function, regexp, etc, are objects in JavaScript.

See is-plain-obj if you want to check for plain objects.

Install

$ npm install is-obj

Usage

import isObject from 'is-obj';

isObject({foo: 'bar'});
//=> true

isObject([1, 2, 3]);
//=> true

isObject('foo');
//=> false
  • is - Type check values

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Last updated on 16 Apr 2021

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc