Socket
Socket
Sign inDemoInstall

core-util-is

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-util-is

The `util.is*` functions introduced in Node v0.12.


Version published
Maintainers
1
Weekly downloads
37,224,734
decreased by-17.76%
Install size
5.75 kB

Weekly downloads

Package description

What is core-util-is?

The core-util-is package provides utility functions for checking the types of JavaScript values, similar to the 'util.is*' functions that were available in Node.js but have since been deprecated. It allows developers to accurately determine the type of a variable, which can be particularly useful when dealing with APIs that may return data of various types or when validating input.

What are core-util-is's main functionalities?

isArray

Checks if a value is an Array.

var is = require('core-util-is');
var result = is.isArray([1, 2, 3]); // result will be true

isBoolean

Checks if a value is a Boolean.

var is = require('core-util-is');
var result = is.isBoolean(false); // result will be true

isNull

Checks if a value is null.

var is = require('core-util-is');
var result = is.isNull(null); // result will be true

isNullOrUndefined

Checks if a value is null or undefined.

var is = require('core-util-is');
var result = is.isNullOrUndefined(null); // result will be true

isNumber

Checks if a value is a Number.

var is = require('core-util-is');
var result = is.isNumber(42); // result will be true

isString

Checks if a value is a String.

var is = require('core-util-is');
var result = is.isString('node'); // result will be true

isSymbol

Checks if a value is a Symbol.

var is = require('core-util-is');
var result = is.isSymbol(Symbol('foo')); // result will be true

isUndefined

Checks if a value is undefined.

var is = require('core-util-is');
var result = is.isUndefined(undefined); // result will be true

isObject

Checks if a value is an Object.

var is = require('core-util-is');
var result = is.isObject({}); // result will be true

isFunction

Checks if a value is a Function.

var is = require('core-util-is');
var result = is.isFunction(function() {}); // result will be true

isPrimitive

Checks if a value is a primitive (not an Object).

var is = require('core-util-is');
var result = is.isPrimitive('string'); // result will be true

isBuffer

Checks if a value is a Buffer object.

var is = require('core-util-is');
var result = is.isBuffer(Buffer.from('node')); // result will be true

Other packages similar to core-util-is

Readme

Source

core-util-is

The util.is* functions introduced in Node v0.12.

Keywords

FAQs

Last updated on 31 Aug 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc