export const toKebabCase = ( string ) : string => { return string . replace ( /[A-Z]+/g , ( match , offset ) => { return `${ offset > 0 ? '-' : '' }${ match . toLocaleLowerCase ( ) }` ; } ) ; } ; export const toPascalCase = ( string ) : string => { return string . replace ( /^./ , ( match ) => match . toLocaleUpperCase ( ) ) . replace ( /-(.)/g , ( match , p1 ) => { return p1 . toLocaleUpperCase ( ) ; } ) ; } ;