Skip to content

Commit

Permalink
fix: 🐛 returns order
Browse files Browse the repository at this point in the history
  • Loading branch information
prc5 committed Dec 10, 2024
1 parent cf25245 commit 7e1c26c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 55 deletions.
14 changes: 9 additions & 5 deletions packages/core/src/pages/utils/display.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,26 @@ export const getSortedChildren = (
};
})
.sort((a, b) => {
const nameA = a.name.startsWith("_");
const nameB = b.name.startsWith("_");
const underscoreNameA = a.name.startsWith("_");
const underscoreNameB = b.name.startsWith("_");

if (a.isMethod && b.isMethod) {
return 0;
}
if (a.isMethod) {
return -1;
return 1;
}

if (nameA && nameB) {
if (underscoreNameA && underscoreNameB) {
return 0;
}
if (nameA) {
if (underscoreNameA) {
return 1;
}
if (!a.isMethod && !b.isMethod) {
return 0;
}

return -1;
})
.filter((element) => element.name !== "constructor");
Expand Down
Loading

0 comments on commit 7e1c26c

Please sign in to comment.