| 1 | package Data::Hash::Diff::Smart::Renderer::JSON; | ||
| 2 | |||
| 3 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 6 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 41 | ▶ | sub render { |
|
Subroutine
render: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 7 | 41 | my $changes = $_[0]; | |
| 8 | |||
| 9 | 41 | require JSON::MaybeXS; | |
| 10 | 41 | JSON::MaybeXS->import(); | |
| 11 | |||
| 12 | # Encode with canonical ordering for stable test output | ||
| 13 | 41 | my $json = JSON::MaybeXS->new( | |
| 14 | utf8 => 1, | ||
| 15 | canonical => 1, | ||
| 16 | pretty => 0, | ||
| 17 | ); | ||
| 18 | |||
| 19 | 41 | return $json->encode($changes); | |
| 20 | } | ||
| 21 | |||
| 22 | 6 | 1; | |