line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Checks::Number; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
291
|
use JMAP::Validation; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
106
|
|
4
|
5
|
|
|
5
|
|
1487
|
use JMAP::Validation::Tests::Number; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
111
|
|
5
|
5
|
|
|
5
|
|
20
|
use Test2::Bundle::Extended; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
24
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
3330
|
use JSON::Typist; |
|
5
|
|
|
|
|
16439
|
|
|
5
|
|
|
|
|
589
|
|
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; |