Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

core-util-is

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-util-is

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

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29M
decreased by-42.22%
Maintainers
1
Weekly downloads
 
Created

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

Keywords

FAQs

Package last updated on 26 Aug 2013

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