line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::uniq; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
106965
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
708
|
use List::MoreUtils qw(uniq); |
|
1
|
|
|
|
|
9940
|
|
|
1
|
|
|
|
|
10
|
|
8
|
1
|
|
|
1
|
|
2524
|
use Catmandu::Util::Path qw(as_path); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
56
|
|
9
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
8
|
|
10
|
1
|
|
|
1
|
|
406
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
11
|
1
|
|
|
1
|
|
746
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _build_fixer { |
18
|
1
|
|
|
1
|
|
11
|
my ($self) = @_; |
19
|
|
|
|
|
|
|
as_path($self->path)->updater( |
20
|
|
|
|
|
|
|
if_array_ref => sub { |
21
|
1
|
|
|
1
|
|
439
|
no warnings 'uninitialized'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
120
|
|
22
|
1
|
|
|
1
|
|
12
|
[List::MoreUtils::uniq(@{$_[0]})]; |
|
1
|
|
|
|
|
33
|
|
23
|
|
|
|
|
|
|
} |
24
|
1
|
|
|
|
|
8
|
); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Catmandu::Fix::uniq - strip duplicate values from an array |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# {tags => ["foo", "bar", "bar", "foo"]} |
40
|
|
|
|
|
|
|
uniq(tags) |
41
|
|
|
|
|
|
|
# {tags => ["foo", "bar"]} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SEE ALSO |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
L<Catmandu::Fix> |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |