Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit c31db24

Browse files
committed
Update
1 parent 0436ebe commit c31db24

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

lib/src/collections/src/merge.dart

+9
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ dynamic mergeDataDeep(
8888
return elseFilter?.call(b) ?? b;
8989
}
9090

91+
/// Merges all [maps] deeply.
92+
Map mergeMapsDeep(List<Map> maps) {
93+
var merged = {};
94+
for (final map in maps) {
95+
merged = mergeDataDeep(merged, map);
96+
}
97+
return merged;
98+
}
99+
91100
/// Merges two data structures deeply and tries to perform toJson on objects.
92101
dynamic mergeDataDeepIncludeCallsToJson(dynamic a, dynamic b) {
93102
return mergeDataDeep(a, b, tryToJson);

lib/src/strings/src/string_case_conversions_on_string_extension.dart

+7-11
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ extension StringCaseConversionsOnStringExtension on String {
3939
String toUpperDotCase() => this.toDotCase().toUpperCase();
4040

4141
/// Converts the string to path/case.
42-
String toPathCase([String separator = '/']) =>
43-
this.extractLowercaseComponents().join(separator);
42+
String toPathCase([String separator = '/']) => this.extractLowercaseComponents().join(separator);
4443

4544
/// Converts the string to camelCase.
4645
String toCamelCase() => this.toPascalCase().withFirstLetterAsLowerCase();
4746

4847
/// Converts the string to PascalCase.
49-
String toPascalCase() =>
50-
this.extractLowercaseComponents().map((e) => e.capitalize()).join();
48+
String toPascalCase() => this.extractLowercaseComponents().map((e) => e.capitalize()).join();
5149

5250
/// Extracts and returns a list of lowercase components from the string.
5351
///
@@ -62,12 +60,12 @@ extension StringCaseConversionsOnStringExtension on String {
6260
///
6361
/// Example:
6462
/// ```dart
65-
/// var example = 'HelloWorld123+456';
66-
/// var components = example.extractLowercaseComponents(special = const {'+'});
63+
/// var example = 'HelloWorld123.456';
64+
/// var components = example.extractLowercaseComponents(special = const {'.'});
6765
/// print(components); // Output: ['hello', 'world', '123+456']
6866
/// ```
6967
List<String> extractLowercaseComponents({
70-
Set<String> special = const {'+'},
68+
Set<String> special = const {'.'},
7169
}) {
7270
if (this.isEmpty) return [this];
7371
final words = <String>[];
@@ -109,12 +107,10 @@ extension StringCaseConversionsOnStringExtension on String {
109107
bool get isLetter => RegExp(r'^[a-zA-Z]$').hasMatch(this);
110108

111109
/// Returns `true` if the string is all uppercase.
112-
bool get isUpperCase =>
113-
this == this.toUpperCase() && this != this.toLowerCase();
110+
bool get isUpperCase => this == this.toUpperCase() && this != this.toLowerCase();
114111

115112
/// Returns `true` if the string is all lowercase.
116-
bool get isLowerCase =>
117-
this == this.toLowerCase() && this != this.toUpperCase();
113+
bool get isLowerCase => this == this.toLowerCase() && this != this.toUpperCase();
118114

119115
/// Capitalizes the first letter of the string.
120116
///

0 commit comments

Comments
 (0)