Socket
Socket
Sign inDemoInstall

object-inspect

Package Overview
Dependencies
0
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.10.0 to 1.10.1

12

index.js

@@ -229,4 +229,14 @@ var hasMap = typeof Map === 'function' && Map.prototype;

function isSymbol(obj) { return toStr(obj) === '[object Symbol]'; }
function isBigInt(obj) { return toStr(obj) === '[object BigInt]'; }
function isBigInt(obj) {
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
return false;
}
try {
bigIntValueOf.call(obj);
return true;
} catch (e) {}
return false;
}
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };

@@ -233,0 +243,0 @@ function has(obj, key) {

2

package.json
{
"name": "object-inspect",
"version": "1.10.0",
"version": "1.10.1",
"description": "string representations of objects in node and the browser",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,3 +1,6 @@

'use strict';
var inspect = require('../');
var test = require('tape');
var hasSymbols = require('has-symbols')();

@@ -30,3 +33,15 @@ test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) {

t.test('toStringTag', { skip: !hasSymbols || typeof Symbol.toStringTag !== 'symbol' }, function (st) {
st.plan(1);
var faker = {};
faker[Symbol.toStringTag] = 'BigInt';
st.equal(
inspect(faker),
'{ [Symbol(Symbol.toStringTag)]: \'BigInt\' }',
'object lying about being a BigInt inspects as an object'
);
});
t.end();
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc