#176 - WIP tokenization of CamelCase words
Technically works, but highlighting needs a rework
This commit is contained in:
@@ -307,3 +307,11 @@ export function chunkArray<T>(arr: T[], len: number): T[][] {
|
||||
|
||||
return chunks
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a 'fooBarBAZLorem' into ['foo', 'Bar', 'BAZ', 'Lorem]
|
||||
* @param text
|
||||
*/
|
||||
export function splitCamelCase(text: string): string[] {
|
||||
return text.replace(/([a-z](?=[A-Z]))/g, '$1 ').split(' ')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user