line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Tests::Address; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
12
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
83
|
|
4
|
4
|
|
|
4
|
|
11
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
70
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
12
|
use JMAP::Validation::Tests::Boolean; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
55
|
|
7
|
4
|
|
|
4
|
|
13
|
use JMAP::Validation::Tests::Object; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
50
|
|
8
|
4
|
|
|
4
|
|
10
|
use JMAP::Validation::Tests::String; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
578
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub is_Address { |
11
|
2488320
|
|
|
2488320
|
0
|
1553064
|
my ($value) = @_; |
12
|
|
|
|
|
|
|
|
13
|
2488320
|
50
|
|
|
|
2959789
|
return unless JMAP::Validation::Tests::Object::is_object($value); |
14
|
|
|
|
|
|
|
|
15
|
2488320
|
50
|
|
|
|
3505463
|
return unless JMAP::Validation::Tests::String::is_string($value->{type}); |
16
|
2488320
|
50
|
|
|
|
6037783
|
return unless $value->{type} =~ qr{^(?:home|work|billing|postal|other)$}; |
17
|
|
|
|
|
|
|
|
18
|
2488320
|
|
|
|
|
9983394
|
foreach my $field (qw{street locality region postcode country}) { |
19
|
12441600
|
50
|
|
|
|
15589191
|
return unless JMAP::Validation::Tests::String::is_string($value->{$field}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
2488320
|
50
|
|
|
|
3208228
|
return unless JMAP::Validation::Tests::Boolean::is_boolean($value->{isDefault}); |
23
|
|
|
|
|
|
|
|
24
|
2488320
|
|
|
|
|
4616176
|
return 1; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |