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 3.2.0 to 3.2.1

15

lib/utils.js

@@ -329,7 +329,16 @@ 'use strict'

function prettifyTime ({ log, timestampKey = TIMESTAMP_KEY, translateFormat = undefined }) {
if (timestampKey in log === false && 'timestamp' in log === false) return undefined
let time = null
if (timestampKey in log) {
time = log[timestampKey]
} else if ('timestamp' in log) {
time = log.timestamp
}
if (time === null) return undefined
if (translateFormat) {
return '[' + formatTime(log[timestampKey] || log.timestamp, translateFormat) + ']'
return '[' + formatTime(time, translateFormat) + ']'
}
return `[${log[timestampKey] || log.timestamp}]`
return `[${time}]`
}

2

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

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

@@ -255,3 +255,13 @@ 'use strict'

t.test('handles the 0 timestamp', async t => {
let log = { time: 0 }
let str = prettifyTime({ log })
t.is(str, '[0]')
log = { timestamp: 0 }
str = prettifyTime({ log })
t.is(str, '[0]')
})
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