Skip to content

Commit d50dbde

Browse files
better code
1 parent 86c79f0 commit d50dbde

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/json_parser/parser.service.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,11 @@ export class ParserService {
6464
.join(`\n`);
6565
}
6666
const bracket_color = config.bracketsColors(depth);
67-
68-
if (currentIndent === 0) {
69-
return (
70-
`<tspan x="0" dy="0" style="fill: ${bracket_color};">{</tspan>\n` +
71-
`${entries}\n` +
72-
`<tspan x="0" dy="19" style="fill: ${bracket_color};">}</tspan>`
73-
);
74-
}
75-
7667
const brackets = Array.isArray(obj) ? '[]' : '{}';
7768
return (
78-
`<tspan style="fill: ${bracket_color};">${brackets[0]}</tspan></tspan>\n` +
69+
`<tspan style="fill: ${bracket_color};">${brackets[0]}</tspan>\n` +
7970
`${entries}\n` +
80-
`<tspan x="${currentIndent}" dy="19"><tspan style="fill: ${bracket_color};">${brackets[1]}</tspan>`
71+
`<tspan x="${currentIndent}" dy="19" style="fill: ${bracket_color};">${brackets[1]}</tspan>`
8172
);
8273
}
8374

0 commit comments

Comments
 (0)