Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
core-util-is
Advanced tools
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.
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
Lodash is a comprehensive utility library that provides a wide range of functions for manipulating and checking data types, among many other utilities. It offers similar type-checking functions like _.isArray, _.isBoolean, etc., and is more extensive than core-util-is.
Kind-of is a simple utility for checking the type of a value. It is similar to core-util-is but provides a single function that returns the type as a string, rather than multiple functions for each type.
The 'is' package offers a set of type check functions for JavaScript, which can be used both in Node.js and in the browser. It is similar to core-util-is but also includes additional checks for types like 'is.integer' or 'is.float'.
The util.is*
functions introduced in Node v0.12.
FAQs
The `util.is*` functions introduced in Node v0.12.
The npm package core-util-is receives a total of 38,537,192 weekly downloads. As such, core-util-is popularity was classified as popular.
We found that core-util-is demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.