Skip to content

Commit

Permalink
feat(inspector): improve merged selector display
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 25, 2024
1 parent 9ee61ef commit 51df0e7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/inspector/client/components/Analyzer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,19 @@ const mergedSelectors = computed(() => {
}
})
return [...map.values()]
const sorted = [...map.values()]
.sort((a, b) => b.count - a.count)
// Use name without bracket if possible
// `[text-sm] text-sm` -> `text-sm`
sorted.forEach((item) => {
if (item.alias) {
item.name = Object.keys(item.alias)
.sort((a, b) => b.localeCompare(a))[0]
}
})
return sorted
})
const grouped = computed(() => mergedSelectors
Expand Down

0 comments on commit 51df0e7

Please sign in to comment.