E58E refactor: use `Array#toSorted()` instead of `Array#sort()` · coreui/coreui-pro@3b3dbf1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b3dbf1

Browse files
committed
refactor: use Array#toSorted() instead of Array#sort()
1 parent 7bbe4a5 commit 3b3dbf1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build/llm.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ CoreUI builds upon Bootstrap by providing production-ready components, advanced
106106
`
107107

108108
const groupOrder = ['components', 'forms', 'utilities', 'helpers']
109-
const sortedGroups = Object.keys(sections).sort((a, b) => {
109+
const sortedGroups = Object.keys(sections).toSorted((a, b) => {
110110
const ai = groupOrder.indexOf(a)
111111
const bi = groupOrder.indexOf(b)
112112
return (ai === -1 ? 999 : ai) - (bi === -1 ? 999 : bi)
@@ -116,7 +116,7 @@ CoreUI builds upon Bootstrap by providing production-ready components, advanced
116116
indexContent += `## 📁 ${
117117
group.charAt(0).toUpperCase() + group.slice(1)
118118
}\n\n`
119-
for (const item of sections[group].sort((a, b) =>
119+
for (const item of sections[group].toSorted((a, b) =>
120120
a.title.localeCompare(b.title)
121121
)) {
122122
indexContent += `- [${item.title}](${item.path})\n`
@@ -146,7 +146,7 @@ async function generateSingleMergedFile() {
146146
let mergedContent = `# 🧠 CoreUI LLM Knowledge Base\n\n`
147147
mergedContent += `This file contains all CoreUI documentation files in a format optimized for large language models (LLMs).\n\n`
148148

149-
for (const filePath of allFiles.sort()) {
149+
for (const filePath of allFiles.toSorted()) {
150150
const relPath = path.relative(inputDir, filePath)
151151
const relativeDir = relPath.split(path.sep)[0]
152152

0 commit comments

Comments
 (0)
0