pino-pretty
Advanced tools
Comparing version 9.2.0 to 9.3.0
@@ -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}` |
{ | ||
"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') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
183806
4066