1var s1 = 'someTextHere';
2var o1 = s1.split(/(?=[A-Z])/).join('_').toLowerCase();
1function convertSnakeToCamelSnake(obj: any){
2 let newTokens = []
3 if (obj) {
4 Object.keys(obj).forEach( key => {
5 newTokens = [] // Reset each loop
6 let tokens = key.split('_')
7 tokens.forEach( token => { newTokens.push(capitalizeFirstLetter(token)) }); // Capitalize first letter of each token
8 newTokens.join('') // Concatenate array indexes to string
9 });
10 }else{
11 console.log("Can not convert case of object:" + obj)
12 }
13 return newTokens
14}