object-inspect
Advanced tools
Comparing version 1.5.0 to 1.6.0
var inspect = require('../'); | ||
var Buffer = require('safer-buffer').Buffer; | ||
var holes = [ 'a', 'b' ]; | ||
@@ -11,3 +13,3 @@ holes[4] = 'e', holes[6] = 'g'; | ||
regex: /^x/i, | ||
buf: new Buffer('abc'), | ||
buf: Buffer.from('abc'), | ||
holes: holes | ||
@@ -14,0 +16,0 @@ }, |
24
index.js
@@ -11,2 +11,3 @@ var hasMap = typeof Map === 'function' && Map.prototype; | ||
var objectToString = Object.prototype.toString; | ||
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; | ||
@@ -42,2 +43,5 @@ var inspectCustom = require('./util.inspect').custom; | ||
} | ||
if (typeof obj === 'bigint') { | ||
return String(obj) + 'n'; | ||
} | ||
@@ -115,2 +119,5 @@ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; | ||
} | ||
if (isBigInt(obj)) { | ||
return markBoxed(inspect(bigIntValueOf.call(obj))); | ||
} | ||
if (isBoolean(obj)) { | ||
@@ -139,10 +146,11 @@ return markBoxed(booleanValueOf.call(obj)); | ||
function isArray (obj) { return toStr(obj) === '[object Array]' } | ||
function isDate (obj) { return toStr(obj) === '[object Date]' } | ||
function isRegExp (obj) { return toStr(obj) === '[object RegExp]' } | ||
function isError (obj) { return toStr(obj) === '[object Error]' } | ||
function isSymbol (obj) { return toStr(obj) === '[object Symbol]' } | ||
function isString (obj) { return toStr(obj) === '[object String]' } | ||
function isNumber (obj) { return toStr(obj) === '[object Number]' } | ||
function isBoolean (obj) { return toStr(obj) === '[object Boolean]' } | ||
function isArray (obj) { return toStr(obj) === '[object Array]'; } | ||
function isDate (obj) { return toStr(obj) === '[object Date]'; } | ||
function isRegExp (obj) { return toStr(obj) === '[object RegExp]'; } | ||
function isError (obj) { return toStr(obj) === '[object Error]'; } | ||
function isSymbol (obj) { return toStr(obj) === '[object Symbol]'; } | ||
function isString (obj) { return toStr(obj) === '[object String]'; } | ||
function isNumber (obj) { return toStr(obj) === '[object Number]'; } | ||
function isBigInt (obj) { return toStr(obj) === '[object BigInt]'; } | ||
function isBoolean (obj) { return toStr(obj) === '[object Boolean]'; } | ||
@@ -149,0 +157,0 @@ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; |
{ | ||
"name": "object-inspect", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "string representations of objects in node and the browser", | ||
"main": "index.js", | ||
"devDependencies": { | ||
"core-js": "^2.5.1", | ||
"core-js": "^2.5.5", | ||
"nyc": "^10.3.2", | ||
"tape": "^4.8.0" | ||
"tape": "^4.9.0" | ||
}, | ||
"scripts": { | ||
"test": "npm run tests-only", | ||
"posttest": "npm run test:bigint", | ||
"pretests-only": "node test-core-js", | ||
"tests-only": "tape test/*.js", | ||
"test:bigint": "node --harmony-bigint test/bigint", | ||
"coverage": "nyc npm run tests-only" | ||
@@ -16,0 +18,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
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
624
32034
27
3