mod: format code

This commit is contained in:
guozhigq
2024-01-07 12:58:24 +08:00
parent 7a71798055
commit fa8fd42e9a
104 changed files with 1077 additions and 1032 deletions

View File

@ -48,19 +48,21 @@ class IdUtils {
}
// 匹配
static Map matchAvorBv({String? input}) {
Map result = {};
static Map<String, dynamic> matchAvorBv({String? input}) {
final Map<String, dynamic> result = {'': null};
if (input == null || input == '') {
return result;
}
RegExp bvRegex = RegExp(r'BV[0-9A-Za-z]{10}', caseSensitive: false);
RegExp avRegex = RegExp(r'AV\d+', caseSensitive: false);
final RegExp bvRegex = RegExp(r'BV[0-9A-Za-z]{10}', caseSensitive: false);
final RegExp avRegex = RegExp(r'AV\d+', caseSensitive: false);
Iterable<Match> bvMatches = bvRegex.allMatches(input);
Iterable<Match> avMatches = avRegex.allMatches(input);
final Iterable<Match> bvMatches = bvRegex.allMatches(input);
final Iterable<Match> avMatches = avRegex.allMatches(input);
List<String> bvs = bvMatches.map((match) => match.group(0)!).toList();
List<String> avs = avMatches.map((match) => match.group(0)!).toList();
final List<String> bvs =
bvMatches.map((Match match) => match.group(0)!).toList();
final List<String> avs =
avMatches.map((Match match) => match.group(0)!).toList();
if (bvs.isNotEmpty) {
result['BV'] = bvs[0].substring(0, 2).toUpperCase() + bvs[0].substring(2);