File Coverage

blib/lib/cPanel/APIClient/Utils/JSON.pm
Criterion Covered Total %
statement 9 11 81.8
branch n/a
condition 0 3 0.0
subroutine 3 5 60.0
pod 0 1 0.0
total 12 20 60.0


line stmt bran cond sub pod time code
1             package cPanel::APIClient::Utils::JSON;
2              
3             # Copyright 2020 cPanel, L. L. C.
4             # All rights reserved.
5             # http://cpanel.net
6             #
7             # This is free software; you can redistribute it and/or modify it under the
8             # same terms as Perl itself. See L.
9              
10 1     1   14 use strict;
  1         1  
  1         32  
11 1     1   6 use warnings;
  1         1  
  1         24  
12              
13 1     1   692 use JSON ();
  1         8610  
  1         93  
14              
15             my $json;
16              
17             sub _json {
18 0   0 0     return $json ||= JSON->new()->utf8(0);
19             }
20              
21             sub decode {
22 0     0 0   return _json()->decode( $_[0] );
23             }
24              
25             1;