Skip to content

Commit 7f304ed

Browse files
committed
chore(docs): alphabetize class members in docs
1 parent c578b07 commit 7f304ed

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

scripts/docs/processors/collect-inputs-outputs.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,22 @@ module.exports = function collectInputsOutputs() {
4040
}
4141

4242
// update doc with pruned members list and add inputs and outputs
43-
doc.members = members;
44-
doc.inputs = inputs;
45-
doc.outputs = outputs;
43+
doc.members = members.sort(alphabetize);
44+
doc.inputs = inputs.sort(alphabetize);
45+
doc.outputs = outputs.sort(alphabetize);
46+
}
47+
48+
function alphabetize(a, b) {
49+
if (!a.name) {
50+
return 1;
51+
} else if (!b.name) {
52+
return -1;
53+
} else if (a.name < b.name) {
54+
return -1;
55+
} else if (a.name > b.name) {
56+
return 1;
57+
}
58+
return 0;
4659
}
4760

4861
function parseMember(member) {

0 commit comments

Comments
 (0)