Skip to content

Commit a4e0e71

Browse files
committed
Create NumberUtils module
1 parent 786730b commit a4e0e71

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Diff for: src/GitFollow/Cli/OptionsNormalizer.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use strict;
1010
use warnings;
1111
use Exporter qw(import);
1212
use GitFollow::Log qw(parse_opts);
13-
use GitFollow::Stdlib::Utils qw(is_numeric);
13+
use GitFollow::Stdlib::NumberUtils qw(is_numeric);
1414

1515
our @EXPORT_OK = qw(
1616
format

Diff for: src/GitFollow/Stdlib/NumberUtils.pm

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
###
2+
### git-follow - Follow lifetime changes of a pathspec in Git.
3+
###
4+
### Copyright (C) 2023 Nickolas Burr <[email protected]>
5+
###
6+
package GitFollow::Stdlib::NumberUtils;
7+
8+
use 5.008;
9+
use strict;
10+
use warnings;
11+
use Exporter qw(import);
12+
13+
our @EXPORT_OK = qw(is_numeric);
14+
15+
sub is_numeric;
16+
17+
# Determine if value is numeric.
18+
sub is_numeric {
19+
my $num = shift;
20+
return (defined $num)
21+
? ($num =~ /^\d+$/ ? 1 : 0) : 0;
22+
}

0 commit comments

Comments
 (0)