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.61'; |
6
|
20
|
|
|
20
|
|
160
|
use CHI::Util qw(json_encode json_decode); |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
2237
|
|
7
|
20
|
|
|
20
|
|
139
|
use Moo; |
|
20
|
|
|
|
|
46
|
|
|
20
|
|
|
|
|
956
|
|
8
|
20
|
|
|
20
|
|
7284
|
use strict; |
|
20
|
|
|
|
|
43
|
|
|
20
|
|
|
|
|
611
|
|
9
|
20
|
|
|
20
|
|
121
|
use warnings; |
|
20
|
|
|
|
|
50
|
|
|
20
|
|
|
|
|
2065
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub serialize { |
12
|
769
|
|
|
769
|
0
|
2652
|
return json_encode( $_[1] ); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub deserialize { |
16
|
0
|
|
|
0
|
0
|
|
return json_decode( $_[1] ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |