Index: utils/dartdoc/utils.dart |
diff --git a/utils/dartdoc/utils.dart b/utils/dartdoc/utils.dart |
index 2819020f7785c2f66ea0b99481437cc0e8396c2c..a77d5fcfeb6616681b2047964896368c8292c41c 100644 |
--- a/utils/dartdoc/utils.dart |
+++ b/utils/dartdoc/utils.dart |
@@ -54,3 +54,15 @@ String unindent(String text, int indentation) { |
return text.substring(start); |
} |
+ |
+/** Sorts the map by the key, doing a case-insensitive comparison. */ |
+List orderByName(Map<String, Dynamic> map) { |
+ // TODO(rnystrom): it'd be nice to have this in corelib. |
+ List keys = map.getKeys(); |
+ keys.sort((x, y) => x.toUpperCase().compareTo(y.toUpperCase())); |
+ final values = []; |
+ for (var k in keys) { |
+ values.add(map[k]); |
+ } |
+ return values; |
+} |