normalizeType static method

ReleaseNotesSectionType normalizeType(
  1. String? value
)

Normalizes simple and rich type strings into section types.

Implementation

static ReleaseNotesSectionType normalizeType(String? value) {
  return switch (value?.trim().toLowerCase()) {
    "feat" || "feature" || "features" => ReleaseNotesSectionType.features,
    "fix" ||
    "fixes" ||
    "bugfix" ||
    "bugfixes" =>
      ReleaseNotesSectionType.fixes,
    "security" => ReleaseNotesSectionType.security,
    "breaking" ||
    "breaking_change" ||
    "breaking-change" ||
    "breaking_changes" ||
    "breaking-changes" =>
      ReleaseNotesSectionType.breaking,
    "other" || "chore" || null || "" => ReleaseNotesSectionType.other,
    _ => ReleaseNotesSectionType.other,
  };
}