Skip to content

Commit 4debdce

Browse files
ci: bump version to v0.9.22
1 parent 13b641d commit 4debdce

15 files changed

+106
-62
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [0.9.22]
44

5-
- Released @ 7/2025 (UTC)
5+
- Released @ 12/2025 (UTC)
66
- Update dependencies
77

88
## [0.9.21]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![tag](https://img.shields.io/badge/Tag-v0.9.22-purple?logo=github)](https://github.com/dev-cetera/df_generate_dart_models_core/tree/v0.9.22)
55
[![buymeacoffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/dev_cetera)
66
[![sponsor](https://img.shields.io/badge/Sponsor-grey?logo=github-sponsors&logoColor=pink)](https://github.com/sponsors/dev-cetera)
7-
[![patreon](https://img.shields.io/badge/Patreon-grey?logo=patreon)](https://www.patreon.com/robelator)
7+
[![patreon](https://img.shields.io/badge/Patreon-grey?logo=patreon)](https://www.patreon.com/t0mb3rr)
88
[![discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white)](https://discord.gg/gEQ8y2nfyX)
99
[![instagram](https://img.shields.io/badge/Instagram-E4405F?logo=instagram&logoColor=white)](https://www.instagram.com/dev_cetera/)
1010
[![license](https://img.shields.io/badge/License-MIT-blue.svg)](https://raw.githubusercontent.com/dev-cetera/df_generate_dart_models_core/main/LICENSE)
@@ -15,6 +15,7 @@
1515

1616
A package that provides core dependencies for models generated with `df_generate_dart_models`.
1717

18+
1819
<!-- END _README_CONTENT -->
1920

2021
---

lib/src/_utils/dart_field.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ final class DartField extends Field {
109109
].any((e) => e == true);
110110
}
111111

112-
bool? get _isFieldNameNullable => super.fieldPath?.any((e) => e.contains('?'));
112+
bool? get _isFieldNameNullable =>
113+
super.fieldPath?.any((e) => e.contains('?'));
113114

114115
bool? get _isFieldTypeNullable => super.fieldType?.endsWith('?') == true;
115116

lib/src/_utils/dart_from_record_on_dart_object_x.dart

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
3333
/// Returns `fieldName` property from [dartObj] if it matches the structure of
3434
/// [TFieldRecord] or `null`.
3535
List<String>? fieldPathFromRecord() {
36-
return _rawFieldPathFromRecord()?.map((e) => e.replaceAll('?', '')).toList();
36+
return _rawFieldPathFromRecord()
37+
?.map((e) => e.replaceAll('?', ''))
38+
.toList();
3739
}
3840

3941
List<String>? _rawFieldPathFromRecord() {
@@ -49,20 +51,30 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
4951
String? fieldTypeFromRecord() {
5052
final raw = _rawFieldTypeFromRecord();
5153
if (raw != null) {
52-
return raw.endsWith('?') || raw.endsWith('*') ? raw.substring(0, raw.length - 1) : raw;
54+
return raw.endsWith('?') || raw.endsWith('*')
55+
? raw.substring(0, raw.length - 1)
56+
: raw;
5357
}
5458
return null;
5559
}
5660

5761
String? _rawFieldTypeFromRecord() {
5862
final a = dartObj.getField('\$2')?.toStringValue() as String?;
5963
final b =
60-
dartObj.getField('\$2')?.toTypeValue()?.getDisplayString(withNullability: true) as String?;
61-
final c = dartObj.getField(FieldModelFieldNames.fieldType)?.toStringValue() as String?;
62-
final d = dartObj
63-
.getField(FieldModelFieldNames.fieldType)
64-
?.toTypeValue()
65-
?.getDisplayString(withNullability: true) as String?;
64+
dartObj
65+
.getField('\$2')
66+
?.toTypeValue()
67+
?.getDisplayString(withNullability: true)
68+
as String?;
69+
final c =
70+
dartObj.getField(FieldModelFieldNames.fieldType)?.toStringValue()
71+
as String?;
72+
final d =
73+
dartObj
74+
.getField(FieldModelFieldNames.fieldType)
75+
?.toTypeValue()
76+
?.getDisplayString(withNullability: true)
77+
as String?;
6678
return a ?? b ?? c ?? d;
6779
}
6880

@@ -73,7 +85,8 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
7385
return false;
7486
}
7587

76-
final a = dartObj.getField(FieldModelFieldNames.nullable)?.toBoolValue() as bool?;
88+
final a =
89+
dartObj.getField(FieldModelFieldNames.nullable)?.toBoolValue() as bool?;
7790
final b = dartObj.getField('\$3')?.toBoolValue() as bool?;
7891
final c = _rawFieldPathFromRecord()?.any((e) => e.contains('?'));
7992
final d = _rawFieldTypeFromRecord()?.endsWith('?');
@@ -83,25 +96,32 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
8396
/// Returns the `children` property from [dartObj] if it matches the structure of
8497
/// [TFieldRecord] or `null`.
8598
List<Map<String, dynamic>>? childrenFromRecord() {
86-
final a = dartObj.getField(FieldModelFieldNames.children)?.toListValue()?.map(
87-
(e) => e.toMapValue()!.map(
88-
(k, v) => MapEntry(k!.toStringValue()!, dartObjToObject(v)),
89-
),
90-
) as Iterable?;
99+
final a =
100+
dartObj
101+
.getField(FieldModelFieldNames.children)
102+
?.toListValue()
103+
?.map(
104+
(e) => e.toMapValue()!.map(
105+
(k, v) => MapEntry(k!.toStringValue()!, dartObjToObject(v)),
106+
),
107+
)
108+
as Iterable?;
91109
final b = a?.map((e) => (e as Map).cast<String, dynamic>()).toList();
92110
return b;
93111
}
94112

95113
/// Returns the `primaryKey` property from [dartObj] if it matches the structure
96114
/// of [TFieldRecord] or `null`.
97115
bool? primaryKeyFromRecord() {
98-
return dartObj.getField(FieldModelFieldNames.primaryKey)?.toBoolValue() as bool?;
116+
return dartObj.getField(FieldModelFieldNames.primaryKey)?.toBoolValue()
117+
as bool?;
99118
}
100119

101120
/// Returns the `foreignKey` property from [dartObj] if it matches the
102121
/// structure of [TFieldRecord] or `null`.
103122
bool? foreignKeyFromRecord() {
104-
return dartObj.getField(FieldModelFieldNames.foreignKey)?.toBoolValue() as bool?;
123+
return dartObj.getField(FieldModelFieldNames.foreignKey)?.toBoolValue()
124+
as bool?;
105125
}
106126

107127
/// Retrieves the `fallback` property from this `DartObject` if it matches
@@ -114,6 +134,7 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
114134
/// Returns the `description` property from [dartObj] record if it matches the
115135
/// structure of [TFieldRecord] or `null`.
116136
String? descriptionFromRecord() {
117-
return dartObj.getField(FieldModelFieldNames.description)?.toStringValue() as String?;
137+
return dartObj.getField(FieldModelFieldNames.description)?.toStringValue()
138+
as String?;
118139
}
119140
}

lib/src/_utils/dart_obj_to_object.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ Object? dartObjToObject(dynamic dartObj) {
3434
} catch (_) {}
3535
try {
3636
return dartObj.toMapValue()!.map(
37-
(dynamic k, dynamic v) => MapEntry(dartObjToObject(k), dartObjToObject(v)),
38-
);
37+
(dynamic k, dynamic v) =>
38+
MapEntry(dartObjToObject(k), dartObjToObject(v)),
39+
);
3940
} catch (_) {}
4041
}
4142
return null;

lib/src/_utils/dart_obj_to_string_list.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ List<String>? dartObjToStringList(dynamic dartObj) {
1818
if (a != null) {
1919
return [a];
2020
}
21-
final b = dartObj
22-
?.toListValue()
23-
?.map((e) => e.toStringValue())
24-
.where((e) => e != null)
25-
.map((e) => e!) as Iterable?;
21+
final b =
22+
dartObj
23+
?.toListValue()
24+
?.map((e) => e.toStringValue())
25+
.where((e) => e != null)
26+
.map((e) => e!)
27+
as Iterable?;
2628

2729
final c = b?.map((e) => e.toString()).toList();
2830
return c;

lib/src/_utils/dart_type_code_mapper.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class DartTypeCodeMapper {
5050
//
5151

5252
String mapObject({required String fieldName, required String fieldTypeCode}) {
53-
final formula = buildObjectMapper(fieldTypeCode, fieldName, mappers) ?? '#x0';
53+
final formula =
54+
buildObjectMapper(fieldTypeCode, fieldName, mappers) ?? '#x0';
5455
return formula;
5556
}
5657

lib/src/_utils/decompose_dart_collection_type.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ Iterable<List<String>> decomposeDartCollectionType(String fieldTypeCode) {
3737
String? decompose(String input) {
3838
// Find all collection type expressions from the input.
3939
const A = r'[\w\-\*\|\?]+';
40-
const B = r'\b('
40+
const B =
41+
r'\b('
4142
'$A'
4243
r')\<(('
4344
'$A'
@@ -50,7 +51,9 @@ Iterable<List<String>> decomposeDartCollectionType(String fieldTypeCode) {
5051
final mappingEntries = matches.map((e) {
5152
final longType = e.group(0)!; // e.g. "List<String,int>"
5253
final shortType = e.group(1)!; // // e.g. "List"
53-
final subtypes = e.group(2)!.split(','); // e.g. ["String", "int"] in "List<String,int>"
54+
final subtypes = e
55+
.group(2)!
56+
.split(','); // e.g. ["String", "int"] in "List<String,int>"
5457
final nullableSymbol = e.group(5) ?? ''; // '?' or ""
5558
final index = e.start; // index in [input] where the match starts
5659
return MapEntry(index, [

lib/src/_utils/strip_special_syntax_from_field_type.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ String stripSpecialSyntaxFromFieldType(String fieldType) {
5757
// brackets back to angle brackets and pluses back to commas.
5858
// This is likely to restore generic type syntax closer to standard Dart or TypeScript formats.
5959
String step4(String input) {
60-
return input.replaceAll('[', '<').replaceAll(']', '>').replaceAll('+', ', ');
60+
return input
61+
.replaceAll('[', '<')
62+
.replaceAll(']', '>')
63+
.replaceAll('+', ', ');
6164
}
6265

6366
// Apply all transformations sequentially to the input String.

lib/src/models/base_model.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ abstract mixin class BaseModel {
6464
/// with the keys sorted alphabetically.
6565
Map<String, dynamic> sortedJson({bool includeNulls = false}) {
6666
final a = toJson(includeNulls: includeNulls);
67-
final b = a.keys.toList(growable: false)..sort((k1, k2) => k1.compareTo(k2));
67+
final b = a.keys.toList(growable: false)
68+
..sort((k1, k2) => k1.compareTo(k2));
6869
final c = {for (var k in b) k: a[k] as dynamic};
6970
return c;
7071
}
@@ -109,7 +110,8 @@ abstract mixin class BaseModel {
109110

110111
/// A class that extends [BaseModel] that provides a reference to itself.
111112
@Deprecated('Use ThisModelMixin instead.')
112-
abstract class ThisModel<T extends BaseModel> extends BaseModel with ThisModelMixin {
113+
abstract class ThisModel<T extends BaseModel> extends BaseModel
114+
with ThisModelMixin {
113115
const ThisModel();
114116
}
115117

0 commit comments

Comments
 (0)