/**
 * Splits name strings into words.
 */ export class NameSplitter { param name returns public split ( name ) { const results = [ ] ; let start = 0 ; for ( let end = 1 ; end < name . length ; end += 1 ) { if ( this . isUpperCase ( name [ end ] ) ) { results . push ( name . substring ( start , end ) ) ; start = end ; } } if ( start !== name . length ) { results . push ( name . substring ( start , name . length ) ) ; } return results ; } param letter returns private isUpperCase ( letter ) { return letter !== letter . toLowerCase ( ) ; } }