normalizeAuthOrganizationRoles function

List<String> normalizeAuthOrganizationRoles(
  1. Iterable<String> roles
)

Normalizes auth organization roles.

Implementation

List<String> normalizeAuthOrganizationRoles(Iterable<String> roles) {
  final normalized =
      roles
          .map((role) => role.trim().toLowerCase())
          .where((role) => role.isNotEmpty)
          .toSet()
          .toList(growable: false)
        ..sort();
  return List<String>.unmodifiable(normalized);
}