Socket
Socket
Sign inDemoInstall

loupe

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loupe - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

14

lib/helpers.js

@@ -157,5 +157,17 @@ const ansiColors = {

function quoteComplexKey(key) {
if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {
return key
}
return JSON.stringify(key)
.replace(/'/g, "\\'")
.replace(/\\"/g, '"')
.replace(/(^"|"$)/g, "'")
}
export function inspectProperty([key, value], options) {
options.truncate -= 2
if (typeof key !== 'string' && typeof key !== 'number') {
if (typeof key === 'string') {
key = quoteComplexKey(key)
} else if (typeof key !== 'number') {
key = `[${options.inspect(key, options)}]`

@@ -162,0 +174,0 @@ }

@@ -624,2 +624,11 @@ (function (global, factory) {

}
function quoteComplexKey(key) {
if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {
return key;
}
return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
}
function inspectProperty(_ref2, options) {

@@ -632,3 +641,5 @@ var _ref3 = _slicedToArray(_ref2, 2),

if (typeof key !== 'string' && typeof key !== 'number') {
if (typeof key === 'string') {
key = quoteComplexKey(key);
} else if (typeof key !== 'number') {
key = "[".concat(options.inspect(key, options), "]");

@@ -635,0 +646,0 @@ }

2

package.json
{
"name": "loupe",
"version": "2.2.0",
"version": "2.2.1",
"description": "Inspect utility for Node.js and browsers",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/chaijs/loupe",

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