File Coverage

lib/APISchema/JSON.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package APISchema::JSON;
2 4     4   137368 use strict;
  4         13  
  4         107  
3 4     4   18 use warnings;
  4         6  
  4         113  
4              
5 4     4   27 use Exporter 'import';
  4         6  
  4         187  
6             our @EXPORT = qw(encode_json_canonical);
7              
8 4     4   22 use JSON::XS;
  4         6  
  4         393  
9              
10             my $json = JSON::XS->new->utf8->canonical(1);
11              
12             sub encode_json_canonical {
13 18     18 0 3272 my ($value) = @_;
14 18         476 $json->encode($value);
15             }
16              
17             1;