We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c0b15d commit db8b4c5Copy full SHA for db8b4c5
src/app/pipes/pretty-print.pipe.ts
@@ -12,6 +12,9 @@ import * as vkbeautify from 'vkbeautify';
12
@Pipe({ name: 'prettyPrint' })
13
export class PrettyPrintPipe implements PipeTransform {
14
transform(value: any) {
15
+ if (value == null || typeof value !== 'string') {
16
+ return '';
17
+ }
18
if (value.charAt(0) === '{' && value.charAt(value.length - 1) === '}') {
19
try {
20
return vkbeautify.json(value);
0 commit comments