object-inspect
Advanced tools
Comparing version 0.1.3 to 0.2.0
10
index.js
@@ -28,2 +28,5 @@ module.exports = function inspect_ (obj, opts, depth, seen) { | ||
} | ||
else if (obj === null) { | ||
return 'null'; | ||
} | ||
else if (isElement(obj)) { | ||
@@ -43,6 +46,9 @@ var s = '<' + String(obj.nodeName).toLowerCase(); | ||
for (var i = 0; i < obj.length; i++) { | ||
xs[i] = inspect(obj[i], obj); | ||
xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; | ||
} | ||
return '[ ' + xs.join(', ') + ' ]'; | ||
} | ||
else if (typeof obj === 'object' && typeof obj.inspect === 'function') { | ||
return obj.inspect(); | ||
} | ||
else if (typeof obj === 'object' && !isDate(obj) && !isRegExp(obj)) { | ||
@@ -79,3 +85,3 @@ var xs = []; | ||
function has (obj, key) { | ||
if (!{}.hasOwnProperty) return true; | ||
if (!{}.hasOwnProperty) return key in obj; | ||
return {}.hasOwnProperty.call(obj, key); | ||
@@ -82,0 +88,0 @@ } |
{ | ||
"name": "object-inspect", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "string representations of objects in node and the browser", | ||
"main": "index.js", | ||
"dependencies": { | ||
"tape": "~1.0.4" | ||
"devDependencies": { | ||
"tape": "~2.6.0" | ||
}, | ||
@@ -9,0 +9,0 @@ "scripts": { |
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
8462
0
14
176
1
- Removedtape@~1.0.4
- Removeddeep-equal@0.0.0(transitive)
- Removeddefined@0.0.0(transitive)
- Removedjsonify@0.0.1(transitive)
- Removedtape@1.0.4(transitive)
- Removedthrough@2.3.8(transitive)