Socket
Socket
Sign inDemoInstall

pino-pretty

Package Overview
Dependencies
Maintainers
4
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-pretty - npm Package Compare versions

Comparing version 9.2.0 to 9.3.0

7

lib/utils.js

@@ -408,2 +408,4 @@ 'use strict'

result += eol
// Avoid printing the escape character on escaped backslashes.
result = result.replace(/\\\\/gi, '\\')
} else {

@@ -413,3 +415,3 @@ // Put each object entry on its own line

// custom prettifiers are already applied above, so we can skip it now
const lines = typeof customPrettifiers[keyName] === 'function'
let lines = typeof customPrettifiers[keyName] === 'function'
? keyValue

@@ -420,2 +422,5 @@ : stringifySafe(keyValue, null, 2)

// Avoid printing the escape character on escaped backslashes.
lines = lines.replace(/\\\\/gi, '\\')
const joinedLines = joinLinesWithIndentation({ input: lines, ident, eol })

@@ -422,0 +427,0 @@ result += `${ident}${keyName}:${joinedLines.startsWith(eol) ? '' : ' '}${joinedLines}${eol}`

2

package.json
{
"name": "pino-pretty",
"version": "9.2.0",
"version": "9.3.0",
"description": "Prettifier for Pino log lines",

@@ -5,0 +5,0 @@ "type": "commonjs",

@@ -273,2 +273,12 @@ 'use strict'

t.test('ignores escaped backslashes in string values', async t => {
const str = prettifyObject({ input: { foo_regexp: '\\[^\\w\\s]\\' } })
t.equal(str, ' foo_regexp: "\\[^\\w\\s]\\"\n')
})
t.test('ignores escaped backslashes in string values (singleLine option)', async t => {
const str = prettifyObject({ input: { foo_regexp: '\\[^\\w\\s]\\' }, singleLine: true })
t.equal(str, '{"foo_regexp":"\\[^\\w\\s]\\"}\n')
})
t.test('works with error props', async t => {

@@ -275,0 +285,0 @@ const err = Error('Something went wrong')

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