line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::Condition::is_string; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
773
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
380
|
use Catmandu::Util qw(is_number is_value); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
49
|
|
9
|
1
|
|
|
1
|
|
7
|
use namespace::clean; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
7
|
|
10
|
1
|
|
|
1
|
|
352
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::Builder::Simple'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _build_value_tester { |
17
|
|
|
|
|
|
|
sub { |
18
|
8
|
100
|
|
8
|
|
184
|
!is_number($_[0]) && is_value($_[0]); |
19
|
1
|
|
|
1
|
|
18
|
}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__ |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=pod |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Catmandu::Fix::Condition::is_string - only execute fixes if all path values are strings |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
if is_string(data.*) |
35
|
|
|
|
|
|
|
... |
36
|
|
|
|
|
|
|
end |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SEE ALSO |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
L<Catmandu::Fix> |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |