New: Natural Sorting Manual Import Paths

(cherry picked from commit bdd5865876796bc203c8117418a5389afc8b5f11)

Closes #1641
This commit is contained in:
Mark McDowall
2022-04-09 21:19:12 -07:00
committed by Bogdan
parent 54c1c7862e
commit 61004ea33f
3 changed files with 16 additions and 2 deletions

View File

@@ -1,9 +1,11 @@
const regex = /\b\w+/g;
function titleCase(input) {
if (!input) {
return '';
}
return input.replace(/\b\w+/g, (match) => {
return input.replace(regex, (match) => {
return match.charAt(0).toUpperCase() + match.substr(1).toLowerCase();
});
}