Socket
Socket
Sign inDemoInstall

object-inspect

Package Overview
Dependencies
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-inspect - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

test/bigint.js

4

example/all.js
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 @@ },

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc