line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
14
|
use v5.12; |
|
1
|
|
|
|
|
4
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Data::Validate::CSV::Types; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.002'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
|
|
12
|
use Type::Library -base, -declare => qw( |
11
|
|
|
|
|
|
|
Table |
12
|
|
|
|
|
|
|
Row |
13
|
|
|
|
|
|
|
Cell |
14
|
|
|
|
|
|
|
Column |
15
|
|
|
|
|
|
|
Schema |
16
|
|
|
|
|
|
|
Note |
17
|
|
|
|
|
|
|
SingleValueCell |
18
|
|
|
|
|
|
|
MultiValueCell |
19
|
1
|
|
|
1
|
|
565
|
); |
|
1
|
|
|
|
|
23240
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
BEGIN { |
22
|
1
|
|
|
1
|
|
1816
|
require Type::Utils; |
23
|
1
|
|
|
|
|
4791
|
Type::Utils::extends(qw( Types::Standard )); |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
|
67056
|
use Types::Path::Tiny qw( Path ); |
|
1
|
|
|
|
|
29922
|
|
|
1
|
|
|
|
|
10
|
|
27
|
1
|
|
|
1
|
|
398
|
use Type::Tiny::Class (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
17
|
|
28
|
1
|
|
|
1
|
|
467
|
use Type::Tiny::Role (); |
|
1
|
|
|
|
|
944
|
|
|
1
|
|
|
|
|
196
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__PACKAGE__->add_type(Type::Tiny::Class->new( |
31
|
|
|
|
|
|
|
name => Table, |
32
|
|
|
|
|
|
|
class => 'Data::Validate::CSV::Table', |
33
|
|
|
|
|
|
|
)); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->add_type(Type::Tiny::Class->new( |
36
|
|
|
|
|
|
|
name => Note, |
37
|
|
|
|
|
|
|
class => 'Data::Validate::CSV::Note', |
38
|
|
|
|
|
|
|
coercion => [ |
39
|
|
|
|
|
|
|
HashRef, q{ 'Data::Validate::CSV::Note'->new($_) }, |
40
|
|
|
|
|
|
|
], |
41
|
|
|
|
|
|
|
)); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__PACKAGE__->add_type(Type::Tiny::Class->new( |
44
|
|
|
|
|
|
|
name => Schema, |
45
|
|
|
|
|
|
|
class => 'Data::Validate::CSV::Schema', |
46
|
|
|
|
|
|
|
coercion => [ |
47
|
|
|
|
|
|
|
HashRef, q{ 'Data::Validate::CSV::Schema'->new_from_hashref($_) }, |
48
|
|
|
|
|
|
|
Str|ScalarRef, q{ 'Data::Validate::CSV::Schema'->new_from_json($_) }, |
49
|
|
|
|
|
|
|
Path, q{ 'Data::Validate::CSV::Schema'->new_from_file($_) }, |
50
|
|
|
|
|
|
|
], |
51
|
|
|
|
|
|
|
)); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__PACKAGE__->add_type(Type::Tiny::Class->new( |
54
|
|
|
|
|
|
|
name => Column, |
55
|
|
|
|
|
|
|
class => 'Data::Validate::CSV::Column', |
56
|
|
|
|
|
|
|
coercion => [ |
57
|
|
|
|
|
|
|
HashRef, q{ 'Data::Validate::CSV::Column'->new($_) }, |
58
|
|
|
|
|
|
|
], |
59
|
|
|
|
|
|
|
)); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__PACKAGE__->add_type(Type::Tiny::Class->new( |
62
|
|
|
|
|
|
|
name => Row, |
63
|
|
|
|
|
|
|
class => 'Data::Validate::CSV::Row', |
64
|
|
|
|
|
|
|
)); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__PACKAGE__->add_type(Type::Tiny::Role->new( |
67
|
|
|
|
|
|
|
name => Cell, |
68
|
|
|
|
|
|
|
role => 'Data::Validate::CSV::Cell', |
69
|
|
|
|
|
|
|
)); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__PACKAGE__->add_type(Type::Tiny::Class->new( |
72
|
|
|
|
|
|
|
name => SingleValueCell, |
73
|
|
|
|
|
|
|
class => 'Data::Validate::CSV::SingleValueCell', |
74
|
|
|
|
|
|
|
)); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__PACKAGE__->add_type(Type::Tiny::Class->new( |
77
|
|
|
|
|
|
|
name => MultiValueCell, |
78
|
|
|
|
|
|
|
class => 'Data::Validate::CSV::MultiValueCell', |
79
|
|
|
|
|
|
|
)); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
__PACKAGE__->make_immutable; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |