File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,19 @@ import type * as Preset from '@docusaurus/preset-classic';
4
4
5
5
const UPPERCASE = new Set ( [ 'jsx' , 'cli' , 'api' ] ) ;
6
6
7
+ const maybeUpperCase = ( str : string ) => {
8
+ const chunks = str . split ( ' ' ) ;
9
+ return chunks
10
+ . map ( ( chunk ) => {
11
+ if ( UPPERCASE . has ( chunk . toLowerCase ( ) ) ) {
12
+ return chunk . toUpperCase ( ) ;
13
+ }
14
+
15
+ return chunk ;
16
+ } )
17
+ . join ( ' ' ) ;
18
+ } ;
19
+
7
20
const config : Config = {
8
21
title : 'CommandKit' ,
9
22
tagline : 'A Discord.js handler' ,
@@ -38,9 +51,11 @@ const config: Config = {
38
51
...item ,
39
52
label : UPPERCASE . has ( item . label ?. toLowerCase ( ) )
40
53
? item . label . toUpperCase ( )
41
- : item . label
42
- . replace ( / - / g, ' ' )
43
- . replace ( / \b \w / g, ( char ) => char . toUpperCase ( ) ) ,
54
+ : maybeUpperCase (
55
+ item . label
56
+ . replace ( / - / g, ' ' )
57
+ . replace ( / \b \w / g, ( char ) => char . toUpperCase ( ) ) ,
58
+ ) ,
44
59
items : item ?. items ?. map ?.( transform ) ,
45
60
} ;
46
61
}
You can’t perform that action at this time.
0 commit comments