Skip to content

Commit

Permalink
fix(jsdocs): sort uncategorized utils to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 6, 2024
1 parent 97e9b47 commit 8f30476
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/generators/jsdocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@ function renderSchema(schema: Schema, opts: { headingLevel: number }) {
}

const lines: string[] = [];
for (const group of Object.keys(sections).sort()) {
for (const group of Object.keys(sections).sort((a, b) => {
if (a === "") {
return 1;
}
if (b === "") {
return -1;
}
return a.localeCompare(b);
})) {
if (group) {
lines.push(`${"#".repeat(opts.headingLevel)} ${group}`, "");
}
Expand Down

0 comments on commit 8f30476

Please sign in to comment.