line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Default key serializer class, so that we don't have to depend on Data::Serializer. |
2
|
|
|
|
|
|
|
# Recommend Data::Serializer for other serializers, rather than reinventing the wheel. |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
package CHI::Serializer::JSON; |
5
|
|
|
|
|
|
|
$CHI::Serializer::JSON::VERSION = '0.60'; |
6
|
20
|
|
|
20
|
|
97
|
use CHI::Util qw(json_encode json_decode); |
|
20
|
|
|
|
|
33
|
|
|
20
|
|
|
|
|
1142
|
|
7
|
20
|
|
|
20
|
|
107
|
use Moo; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
121
|
|
8
|
20
|
|
|
20
|
|
8634
|
use strict; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
588
|
|
9
|
20
|
|
|
20
|
|
84
|
use warnings; |
|
20
|
|
|
|
|
28
|
|
|
20
|
|
|
|
|
1441
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub serialize { |
12
|
553
|
|
|
553
|
0
|
1801
|
return json_encode( $_[1] ); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub deserialize { |
16
|
0
|
|
|
0
|
0
|
|
return json_decode( $_[1] ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |