object-inspect
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -34,2 +34,6 @@ module.exports = function inspect_ (obj, opts, depth, seen) { | ||
} | ||
else if (isSymbol(obj)) { | ||
var symString = Symbol.prototype.toString.call(obj); | ||
return typeof obj === 'object' ? 'Object(' + symString + ')' : symString; | ||
} | ||
else if (isElement(obj)) { | ||
@@ -99,2 +103,3 @@ var s = '<' + String(obj.nodeName).toLowerCase(); | ||
function isError (obj) { return toStr(obj) === '[object Error]' } | ||
function isSymbol (obj) { return toStr(obj) === '[object Symbol]' } | ||
@@ -101,0 +106,0 @@ function has (obj, key) { |
{ | ||
"name": "object-inspect", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "string representations of objects in node and the browser", | ||
"main": "index.js", | ||
"devDependencies": { | ||
"tape": "^2.13.3" | ||
"tape": "^2.14.0" | ||
}, | ||
@@ -9,0 +9,0 @@ "scripts": { |
@@ -57,1 +57,8 @@ var inspect = require('../'); | ||
}); | ||
test('symbols', { skip: typeof Symbol !== 'function' }, function (t) { | ||
var sym = Symbol('foo'); | ||
t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"'); | ||
t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"'); | ||
t.end(); | ||
}); |
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
14453
366