line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Tests::Address; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
13
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
79
|
|
4
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
4
|
|
|
|
|
2
|
|
|
4
|
|
|
|
|
108
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
13
|
use JMAP::Validation::Tests::Boolean; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
60
|
|
7
|
4
|
|
|
4
|
|
11
|
use JMAP::Validation::Tests::Object; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
71
|
|
8
|
4
|
|
|
4
|
|
11
|
use JMAP::Validation::Tests::String; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
551
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub is_Address { |
11
|
2488320
|
|
|
2488320
|
0
|
1537398
|
my ($value) = @_; |
12
|
|
|
|
|
|
|
|
13
|
2488320
|
50
|
|
|
|
2999036
|
return unless JMAP::Validation::Tests::Object::is_object($value); |
14
|
|
|
|
|
|
|
|
15
|
2488320
|
50
|
|
|
|
3551070
|
return unless JMAP::Validation::Tests::String::is_string($value->{type}); |
16
|
2488320
|
50
|
|
|
|
5749741
|
return unless $value->{type} =~ qr{^(?:home|work|billing|postal|other)$}; |
17
|
|
|
|
|
|
|
|
18
|
2488320
|
|
|
|
|
9789918
|
foreach my $field (qw{street locality region postcode country}) { |
19
|
12441600
|
50
|
|
|
|
15885641
|
return unless JMAP::Validation::Tests::String::is_string($value->{$field}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
2488320
|
50
|
|
|
|
3202846
|
return unless JMAP::Validation::Tests::Boolean::is_boolean($value->{isDefault}); |
23
|
|
|
|
|
|
|
|
24
|
2488320
|
|
|
|
|
4551751
|
return 1; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |