line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JMAP::Validation::Checks::Number; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
261
|
use JMAP::Validation; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
107
|
|
4
|
5
|
|
|
5
|
|
1505
|
use JMAP::Validation::Tests::Number; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
100
|
|
5
|
5
|
|
|
5
|
|
16
|
use Test2::Bundle::Extended; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
20
|
|
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
3312
|
use JSON::Typist; |
|
5
|
|
|
|
|
15860
|
|
|
5
|
|
|
|
|
576
|
|
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; |