core-util-is
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23195
6
1
142