Skip to content

Commit a16410b

Browse files
committed
sort library language cards by language name
1 parent ef8993f commit a16410b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

views/website/libraries/support/get-languages.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,19 @@ module.exports = function getLanguages() {
2323
result.push(data);
2424
});
2525

26+
result.sort((a, b) => {
27+
const nameA = a.name.toUpperCase(); // ignore upper and lowercase
28+
const nameB = b.name.toUpperCase(); // ignore upper and lowercase
29+
if (nameA < nameB) {
30+
return -1;
31+
}
32+
if (nameA > nameB) {
33+
return 1;
34+
}
35+
36+
// names must be equal
37+
return 0;
38+
})
39+
2640
return result;
27-
};
41+
};

0 commit comments

Comments
 (0)