mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Fix title case transformer
This commit is contained in:
+3
-1
@@ -88,7 +88,9 @@ const titleCasePostProcessor: PostProcessorModule = {
|
|||||||
type: 'postProcessor',
|
type: 'postProcessor',
|
||||||
name: 'titleCase',
|
name: 'titleCase',
|
||||||
process: (value: string) => {
|
process: (value: string) => {
|
||||||
return value.charAt(0).toLocaleUpperCase() + value.slice(1).toLowerCase();
|
return value.replace(/\S\S*/g, (txt) => {
|
||||||
|
return txt.charAt(0).toLocaleUpperCase() + txt.slice(1).toLowerCase();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user