Skip to content

Commit 7e1c26c

Browse files
committed
fix: 🐛 returns order
1 parent cf25245 commit 7e1c26c

File tree

2 files changed

+59
-55
lines changed

2 files changed

+59
-55
lines changed

packages/core/src/pages/utils/display.utils.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,26 @@ export const getSortedChildren = (
9999
};
100100
})
101101
.sort((a, b) => {
102-
const nameA = a.name.startsWith("_");
103-
const nameB = b.name.startsWith("_");
102+
const underscoreNameA = a.name.startsWith("_");
103+
const underscoreNameB = b.name.startsWith("_");
104104

105105
if (a.isMethod && b.isMethod) {
106106
return 0;
107107
}
108108
if (a.isMethod) {
109-
return -1;
109+
return 1;
110110
}
111111

112-
if (nameA && nameB) {
112+
if (underscoreNameA && underscoreNameB) {
113113
return 0;
114114
}
115-
if (nameA) {
115+
if (underscoreNameA) {
116116
return 1;
117117
}
118+
if (!a.isMethod && !b.isMethod) {
119+
return 0;
120+
}
121+
118122
return -1;
119123
})
120124
.filter((element) => element.name !== "constructor");

0 commit comments

Comments
 (0)