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 - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

LICENSE

22

lib/util.js

@@ -24,4 +24,8 @@ // Copyright Joyent, Inc. and other Node contributors.

// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
return Array.isArray(ar);
function isArray(arg) {
if (Array.isArray) {
return Array.isArray(arg);
}
return objectToString(arg) === '[object Array]';
}

@@ -66,3 +70,3 @@ exports.isArray = isArray;

function isRegExp(re) {
return isObject(re) && objectToString(re) === '[object RegExp]';
return objectToString(re) === '[object RegExp]';
}

@@ -77,3 +81,3 @@ exports.isRegExp = isRegExp;

function isDate(d) {
return isObject(d) && objectToString(d) === '[object Date]';
return objectToString(d) === '[object Date]';
}

@@ -83,4 +87,3 @@ exports.isDate = isDate;

function isError(e) {
return isObject(e) &&
(objectToString(e) === '[object Error]' || e instanceof Error);
return (objectToString(e) === '[object Error]' || e instanceof Error);
}

@@ -104,9 +107,6 @@ exports.isError = isError;

function isBuffer(arg) {
return Buffer.isBuffer(arg);
}
exports.isBuffer = isBuffer;
exports.isBuffer = Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
}
}
{
"name": "core-util-is",
"version": "1.0.1",
"version": "1.0.2",
"description": "The `util.is*` functions introduced in Node v0.12.",

@@ -25,3 +25,9 @@ "main": "lib/util.js",

"url": "https://github.com/isaacs/core-util-is/issues"
},
"scripts": {
"test": "tap test.js"
},
"devDependencies": {
"tap": "^2.3.0"
}
}
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