Skip to content

Commit 475eea1

Browse files
committed
More consistent sorting of items in index.json
classes and constructors often have the same qualifiedName This changes takes the type into account when there is a conflict
1 parent 2d990a7 commit 475eea1

File tree

2 files changed

+149
-147
lines changed

2 files changed

+149
-147
lines changed

lib/src/html/html_generator_instance.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ class HtmlGeneratorInstance implements HtmlOptions {
8181
return data;
8282
}).toList()
8383
..sort((a, b) {
84-
var aQualified = a['qualifiedName'] as String;
85-
var bQualified = b['qualifiedName'] as String;
86-
return compareNatural(aQualified, bQualified);
84+
var value = compareNatural(a['qualifiedName'], b['qualifiedName']);
85+
if (value == 0) {
86+
value = compareNatural(a['type'], b['type']);
87+
}
88+
return value;
8789
}));
8890
jsonFile.writeAsStringSync('${json}\n');
8991
}

0 commit comments

Comments
 (0)