line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
35202
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
43
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
94
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Types::UUID; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.002'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
1238
|
use Type::Library -base; |
|
1
|
|
|
|
|
21415
|
|
|
1
|
|
|
|
|
9
|
|
11
|
1
|
|
|
1
|
|
220
|
use Type::Tiny (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
12
|
1
|
|
|
1
|
|
1148
|
use Types::Standard qw( Undef Str InstanceOf ); |
|
1
|
|
|
|
|
50396
|
|
|
1
|
|
|
|
|
15
|
|
13
|
1
|
|
|
1
|
|
2375
|
use UUID::Tiny qw( :std ); |
|
1
|
|
|
|
|
46940
|
|
|
1
|
|
|
|
|
606
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT = qw( Uuid ); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $type = __PACKAGE__->add_type( |
18
|
|
|
|
|
|
|
name => 'Uuid', |
19
|
|
|
|
|
|
|
parent => Str, |
20
|
|
|
|
|
|
|
constraint => \&is_uuid_string, |
21
|
|
|
|
|
|
|
inlined => sub { |
22
|
|
|
|
|
|
|
return ( |
23
|
|
|
|
|
|
|
Str->inline_check($_), |
24
|
|
|
|
|
|
|
"UUID::Tiny::is_uuid_string($_)", |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
}, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$type->coercion->add_type_coercions( |
30
|
|
|
|
|
|
|
Undef ,=> q[UUID::Tiny::create_uuid_as_string()], |
31
|
|
|
|
|
|
|
Str ,=> q[eval{ UUID::Tiny::uuid_to_string(UUID::Tiny::string_to_uuid($_)) }], |
32
|
|
|
|
|
|
|
InstanceOf['URI'] ,=> q[eval{ UUID::Tiny::uuid_to_string(UUID::Tiny::string_to_uuid(q().$_)) }], |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$type->coercion->freeze; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |