const regex = /([^\*])\1{2,}/gm;
let text = 'hhollllllláááááááááááá))))';
let truncatedText = text;
while ((arr = regex.exec(text)) !== null) {
let match = arr[0];
let character = match.charAt(0)
truncatedText = truncatedText.replace(match, character.repeat(2));
}
console.log(`==== Result: ${truncatedText}`);