Socket
Socket
Sign inDemoInstall

is-what

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-what

JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.


Version published
Weekly downloads
6.9M
increased by3.98%
Maintainers
1
Weekly downloads
 
Created

What is is-what?

The is-what npm package provides utility functions to check the type of a given value. It helps in determining whether a value is an object, array, function, string, number, etc. This can be particularly useful in type-checking scenarios and ensuring that values conform to expected types.

What are is-what's main functionalities?

isObject

The isObject function checks if a given value is a plain object. It returns true for plain objects and false for arrays and other types.

const { isObject } = require('is-what');
console.log(isObject({})); // true
console.log(isObject([])); // false

isArray

The isArray function checks if a given value is an array. It returns true for arrays and false for other types.

const { isArray } = require('is-what');
console.log(isArray([])); // true
console.log(isArray({})); // false

isFunction

The isFunction function checks if a given value is a function. It returns true for functions and false for other types.

const { isFunction } = require('is-what');
console.log(isFunction(function() {})); // true
console.log(isFunction({})); // false

isString

The isString function checks if a given value is a string. It returns true for strings and false for other types.

const { isString } = require('is-what');
console.log(isString('hello')); // true
console.log(isString(123)); // false

isNumber

The isNumber function checks if a given value is a number. It returns true for numbers and false for other types.

const { isNumber } = require('is-what');
console.log(isNumber(123)); // true
console.log(isNumber('123')); // false

Other packages similar to is-what

Keywords

FAQs

Package last updated on 01 Dec 2022

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