toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'version': version,
if (previousVersion != null) 'previousVersion': previousVersion,
if (tag != null) 'tag': tag,
if (previousTag != null) 'previousTag': previousTag,
'commitCount': totalCommits,
'hasBreakingChanges': hasBreakingChanges,
'generatedAt': generatedAt.toIso8601String(),
'categories': categories.map(
(cat, list) => MapEntry(
cat,
list.map((c) => c.cleanDescription).toList(),
),
),
if (hasBreakingChanges)
'breakingChanges': breakingChanges
.map((c) => c.breakingDescription ?? c.cleanDescription)
.toList(),
};
}