Skip to content

Commit

Permalink
feat: add json pretty print for json columns (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
mansoorkhan96 authored Sep 21, 2024
1 parent ae815f0 commit b3f3512
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public function render(?string $renderer = null, array $differOptions = [], arra

$createDiff = function ($key, $old, $new) use (&$diff, $renderer, $differOptions, $renderOptions) {
if ($renderer) {
$old = is_string($old) ? $old : json_encode($old);
$new = is_string($new) ? $new : json_encode($new);
$old = is_string($old) ? $old : json_encode($old, JSON_PRETTY_PRINT);
$new = is_string($new) ? $new : json_encode($new, JSON_PRETTY_PRINT);
$diff[$key] = str_replace('\n No newline at end of file', '', DiffHelper::calculate($old, $new, $renderer, $differOptions, $renderOptions));
} else {
$diff[$key] = compact('old', 'new');
Expand Down

0 comments on commit b3f3512

Please sign in to comment.