Skip to content

Commit

Permalink
fix: dart formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
drxddy committed Dec 8, 2024
1 parent 63504e5 commit cb744e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pkg/linter/lib/src/rules/null_closures.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ final Map<String, Set<NonNullableFunction>>
},
'splitMap': {
NonNullableFunction('dart.core', 'Iterable', 'splitMap',
named: ['onMatch', 'onNonMatch']),
named: ['onMatch', 'onNonMatch']),
},
'takeWhile': {
NonNullableFunction('dart.core', 'Iterable', 'takeWhile', positional: [0]),
Expand Down
17 changes: 9 additions & 8 deletions sdk/lib/_internal/js_dev_runtime/private/js_string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,20 @@ final class JSString extends Interceptor

@notNull
Iterable<T> splitMap<T>(
Pattern pattern, {
T Function(Match match)? onMatch,
T Function(String nonMatch)? onNonMatch,
}) {
return stringSplitMapUnchecked(this, pattern, onMatch, onNonMatch);
}
Pattern pattern, {
T Function(Match match)? onMatch,
T Function(String nonMatch)? onNonMatch,
}) {
return stringSplitMapUnchecked(this, pattern, onMatch, onNonMatch);
}

Iterable<T> stringSplitMapUnchecked<T>(String receiver, Pattern pattern,
Iterable<T> stringSplitMapUnchecked<T>(String receiver, Pattern pattern,
T Function(Match)? onMatch, T Function(String)? onNonMatch) {
onMatch ??= (match) => match[0]! as T;
onNonMatch ??= (string) => string as T;
if (pattern is String) {
return stringSplitStringMapUnchecked(receiver, pattern, onMatch, onNonMatch);
return stringSplitStringMapUnchecked(
receiver, pattern, onMatch, onNonMatch);
}
if (pattern is JSSyntaxRegExp) {
return stringSplitJSRegExpMapUnchecked(receiver, pattern, onMatch, onNonMatch);
Expand Down
2 changes: 1 addition & 1 deletion sdk/lib/_internal/js_runtime/lib/js_string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ final class JSString extends Interceptor
}

Iterable<T> stringSplitMapUnchecked<T>(String receiver, Pattern pattern,
T Function(Match)? onMatch, T Function(String)? onNonMatch) {
T Function(Match)? onMatch, T Function(String)? onNonMatch) {
onMatch ??= (match) => match[0]! as T;
onNonMatch ??= (string) => string as T;
if (pattern is String) {
Expand Down

0 comments on commit cb744e1

Please sign in to comment.