line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Tests::Address; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
14
|
use strict; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
84
|
|
4
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
64
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
14
|
use JMAP::Validation::Tests::Boolean; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
62
|
|
7
|
4
|
|
|
4
|
|
13
|
use JMAP::Validation::Tests::Object; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
77
|
|
8
|
4
|
|
|
4
|
|
16
|
use JMAP::Validation::Tests::String; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
556
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub is_Address { |
11
|
2488320
|
|
|
2488320
|
0
|
1607070
|
my ($value) = @_; |
12
|
|
|
|
|
|
|
|
13
|
2488320
|
50
|
|
|
|
3027699
|
return unless JMAP::Validation::Tests::Object::is_object($value); |
14
|
|
|
|
|
|
|
|
15
|
2488320
|
50
|
|
|
|
3453462
|
return unless JMAP::Validation::Tests::String::is_string($value->{type}); |
16
|
2488320
|
50
|
|
|
|
6069478
|
return unless $value->{type} =~ qr{^(?:home|work|billing|postal|other)$}; |
17
|
|
|
|
|
|
|
|
18
|
2488320
|
|
|
|
|
10413304
|
foreach my $field (qw{street locality region postcode country}) { |
19
|
12441600
|
50
|
|
|
|
16049253
|
return unless JMAP::Validation::Tests::String::is_string($value->{$field}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
2488320
|
50
|
|
|
|
3349209
|
return unless JMAP::Validation::Tests::Boolean::is_boolean($value->{isDefault}); |
23
|
|
|
|
|
|
|
|
24
|
2488320
|
|
|
|
|
4712703
|
return 1; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |