object-inspect
Advanced tools
Comparing version 1.3.0 to 1.4.0
11
index.js
@@ -12,2 +12,5 @@ var hasMap = typeof Map === 'function' && Map.prototype; | ||
var inspectCustom = require('./util.inspect').custom; | ||
var inspectSymbol = (inspectCustom && isSymbol(inspectCustom)) ? inspectCustom : null; | ||
module.exports = function inspect_ (obj, opts, depth, seen) { | ||
@@ -82,4 +85,8 @@ if (typeof obj === 'undefined') { | ||
} | ||
if (typeof obj === 'object' && typeof obj.inspect === 'function') { | ||
return obj.inspect(); | ||
if (typeof obj === 'object') { | ||
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { | ||
return obj[inspectSymbol](); | ||
} else if (typeof obj.inspect === 'function') { | ||
return obj.inspect(); | ||
} | ||
} | ||
@@ -86,0 +93,0 @@ if (isMap(obj)) { |
{ | ||
"name": "object-inspect", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "string representations of objects in node and the browser", | ||
"main": "index.js", | ||
"devDependencies": { | ||
"core-js": "^2.4.1", | ||
"tape": "^4.7.0" | ||
"core-js": "^2.5.1", | ||
"nyc": "^10.3.2", | ||
"tape": "^4.8.0" | ||
}, | ||
@@ -13,3 +14,4 @@ "scripts": { | ||
"pretests-only": "node test-core-js", | ||
"tests-only": "tape test/*.js" | ||
"tests-only": "tape test/*.js", | ||
"coverage": "nyc npm run tests-only" | ||
}, | ||
@@ -49,3 +51,6 @@ "testling": { | ||
}, | ||
"license": "MIT" | ||
"license": "MIT", | ||
"browser": { | ||
"./util.inspect.js": false | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
73140
31
558
3