line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Checks::Number; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
277
|
use JMAP::Validation; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
115
|
|
4
|
5
|
|
|
5
|
|
1546
|
use JMAP::Validation::Tests::Number; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
100
|
|
5
|
5
|
|
|
5
|
|
20
|
use Test2::Bundle::Extended; |
|
5
|
|
|
|
|
3
|
|
|
5
|
|
|
|
|
22
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
5762
|
use JSON::Typist; |
|
5
|
|
|
|
|
16823
|
|
|
5
|
|
|
|
|
609
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $is_number = validator(sub { |
10
|
|
|
|
|
|
|
my (%params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return (ref($params{got}) || '') eq 'JSON::Typist::Number'; |
13
|
|
|
|
|
|
|
}); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $is_number_or_null = validator(sub { |
16
|
|
|
|
|
|
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
if (defined $params{got}) { |
19
|
|
|
|
|
|
|
return unless JMAP::Validation::validate( |
20
|
|
|
|
|
|
|
$params{got}, |
21
|
|
|
|
|
|
|
$is_number, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
return 1; |
26
|
|
|
|
|
|
|
}); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |