const detectNonLetterRegexp=/[^A-Z--]/g;

function stripDiacritics(phrase:string){
    return phrase.normalize('NFD').replace(/[\u0300-\u036f]/g, "")
}

function isPalindrome(phrase:string){
    const TheLetters = stripDiacritics(phrase.toLocaleUpperCase().replace(detectNonLetterRegexp, ''));
    const middlePosition = TheLetters.length/2;
    const leftHalf = TheLetters.substr(0, middlePosition);
    const rightReverseHalf = TheLetters.substr(-middlePosition).split('').reverse().join('');
    return leftHalf == rightReverseHalf;
}

console.log(isPalindrome('Sueo que esto no es un palndromo'))
console.log(isPalindrome('Dbale arroz a la zorra el abad!'))
console.log(isPalindrome('    '))