A: 

Though it doesn't seem a optimal way, I can recommend you one thing. So, first of all you need to know all the escape sequences in javascript. You can get those here. Now as there are not too many of them, you can check the presence of each of the escape sequences individually in the provided string. To do this you can use

if(str.length!=str.replace("\r","")) //To check whether "\r" is present or not.

Similarly you have to do for other escape sequences. So, nevertheless of any string you will at least know whether any escape sequences are there are not and if yes you can handle that string as per your requirement.

Bipul