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 2.2.3 to 2.2.4

9

index.js

@@ -224,5 +224,7 @@ 'use strict'

if (errorLikeObjectKeys.indexOf(keys[i]) !== -1 && value[keys[i]] !== undefined) {
const lines = JSON.stringify(value[keys[i]], null, 2)
if (lines === undefined) continue
const arrayOfLines = (
IDENT + keys[i] + ': ' +
joinLinesWithIndentation(JSON.stringify(value[keys[i]], null, 2)) +
joinLinesWithIndentation(lines) +
EOL

@@ -253,3 +255,6 @@ ).split('\n')

if (value[keys[i]] !== undefined) {
result += IDENT + keys[i] + ': ' + joinLinesWithIndentation(JSON.stringify(value[keys[i]], null, 2)) + EOL
const lines = JSON.stringify(value[keys[i]], null, 2)
if (lines !== undefined) {
result += IDENT + keys[i] + ': ' + joinLinesWithIndentation(lines) + EOL
}
}

@@ -256,0 +261,0 @@ }

{
"name": "pino-pretty",
"version": "2.2.3",
"version": "2.2.4",
"description": "Prettifier for Pino log lines",

@@ -43,8 +43,8 @@ "main": "index.js",

"devDependencies": {
"pino": "^5.8.0",
"pino": "^5.8.1",
"pre-commit": "^1.2.2",
"snazzy": "^8.0.0",
"standard": "^12.0.1",
"tap": "^12.0.1"
"tap": "^12.1.0"
}
}

@@ -488,3 +488,28 @@ 'use strict'

t.test('prettifies object with some undefined values', (t) => {
t.plan(1)
const dest = new Writable({
write (chunk, _, cb) {
t.is(
chunk + '',
`[${epoch}] INFO (${pid} on ${hostname}): \n a: {\n "b": "c"\n }\n n: null\n`
)
cb()
}
})
const log = pino({
prettifier: prettyFactory,
prettyPrint: true
}, dest)
log.info({
a: { b: 'c' },
s: Symbol.for('s'),
f: f => f,
c: class C {},
n: null,
err: { toJSON () {} }
})
})
t.end()
})
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