Skip to content

Commit 83fcfbe

Browse files
refactor: Split converters.dart and index.dart into individual files
Splits the `mapper/lib/src/model/converters.dart` and `mapper/lib/src/model/index.dart` files into individual files. This improves maintainability and readability of the code. - Created new directories `mapper/lib/src/model/converters` and `mapper/lib/src/model/index`. - Moved each class and definition to its own file within the new directories. - Replaced the original `converters.dart` and `index.dart` with barrel files that export all the new files, ensuring no breaking changes for existing importers. - Added a newline to the end of all new files.
1 parent 14be124 commit 83fcfbe

20 files changed

+20
-20
lines changed

mapper/lib/src/model/converters/base_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ class BaseCustomConverter {
5353
? jsonProperty.converterParams![name]
5454
: null;
5555
}
56-
}
56+
}

mapper/lib/src/model/converters/bigint_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ class BigIntConverter implements ICustomConverter {
1616
dynamic toJSON(Object? object, SerializationContext context) {
1717
return object is BigInt ? object.toString() : object;
1818
}
19-
}
19+
}

mapper/lib/src/model/converters/date_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ class DateConverter extends BaseCustomConverter implements ICustomConverter {
3636
String? format = getConverterParameter('format', jsonProperty);
3737
return format != null ? DateFormat(format) : null;
3838
}
39-
}
39+
}

mapper/lib/src/model/converters/default_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ class DefaultConverter implements ICustomConverter {
3939

4040
@override
4141
dynamic toJSON(Object? object, SerializationContext context) => object;
42-
}
42+
}

mapper/lib/src/model/converters/default_iterable_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ class DefaultIterableConverter extends BaseCustomConverter
7171
void setIterableInstance(Iterable? instance) {
7272
_instance = instance;
7373
}
74-
}
74+
}

mapper/lib/src/model/converters/duration_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ class DurationConverter implements ICustomConverter<Duration?> {
1818
dynamic toJSON(Duration? object, SerializationContext context) {
1919
return object?.inMicroseconds;
2020
}
21-
}
21+
}

mapper/lib/src/model/converters/enum_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ class EnumConverter implements ICustomConverter, ICustomEnumConverter {
3131
void setEnumDescriptor(IEnumDescriptor? enumDescriptor) {
3232
_enumDescriptor = enumDescriptor;
3333
}
34-
}
34+
}

mapper/lib/src/model/converters/enum_converter_numeric.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ class EnumConverterNumeric implements ICustomConverter, ICustomEnumConverter {
4949
void setEnumDescriptor(IEnumDescriptor? enumDescriptor) {
5050
_enumDescriptor = enumDescriptor;
5151
}
52-
}
52+
}

mapper/lib/src/model/converters/enum_converter_short.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ class EnumConverterShort implements ICustomConverter, ICustomEnumConverter {
7171
dynamic _mapValue(dynamic value, Map mapping) => mapping.containsKey(value)
7272
? mapping[value]
7373
: value.toString().split('.').last;
74-
}
74+
}

mapper/lib/src/model/converters/map_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ class MapConverter
7070
void setMapInstance(Map? instance) {
7171
_instance = instance;
7272
}
73-
}
73+
}

0 commit comments

Comments
 (0)