Skip to content

Commit 30d06b3

Browse files
committed
Refactor: Clarified duration regexp
1 parent 0bea301 commit 30d06b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/config/option_types.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class DurationParser extends ValueParser<Duration> {
333333
@override
334334
Duration parse(final String value) {
335335
// integer followed by an optional unit (s, m, h, d, ms, us)
336-
const pattern = r'^(-?\d+)([smhd]|ms|us)?$';
336+
const pattern = r'^(-?\d+)(ms|us|[smhd])?$';
337337
final regex = RegExp(pattern);
338338
final match = regex.firstMatch(value);
339339

0 commit comments

Comments
 (0)