File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ class HtmlGeneratorInstance implements HtmlOptions {
6262 var encoder =
6363 prettyIndexJson ? new JsonEncoder .withIndent (' ' ) : new JsonEncoder ();
6464
65- File jsonFile = _createOutputFile (path.join (out.path, 'index.json' ));
66- String json = encoder.convert (
65+ final List <Map > indexItems =
6766 documentedElements.where ((e) => e.isCanonical).map ((ModelElement e) {
6867 Map data = {
6968 'name' : e.name,
@@ -82,15 +81,18 @@ class HtmlGeneratorInstance implements HtmlOptions {
8281 data['qualifiedName' ] = e.fullyQualifiedName;
8382 }
8483 return data;
85- }).toList ()
86- ..sort ((a, b) {
87- var value = compareNatural (a['qualifiedName' ], b['qualifiedName' ]);
88- if (value == 0 ) {
89- value = compareNatural (a['type' ], b['type' ]);
90- }
91- return value;
92- }));
93- jsonFile.writeAsStringSync ('${json }\n ' );
84+ }).toList ();
85+
86+ indexItems.sort ((a, b) {
87+ var value = compareNatural (a['qualifiedName' ], b['qualifiedName' ]);
88+ if (value == 0 ) {
89+ value = compareNatural (a['type' ], b['type' ]);
90+ }
91+ return value;
92+ });
93+
94+ String json = encoder.convert (indexItems);
95+ _writeFile (path.join (out.path, 'index.json' ), '${json }\n ' );
9496 }
9597
9698 void _generateDocs () {
You can’t perform that action at this time.
0 commit comments