Turns indentation into {curly brackets} Great for a yml to json converter or something. Credit to @maettig for writing all* the code.
Turn this:
if(3==3)
alert("obviously!")
alert("lol!")
Into:
if(3==3){
alert("obviously!")
alert("lol!")
}
jsperf showing the different methods:
http://jsperf.com/blockifyindents
*almost
@maettig
Sweet! I'll test it a bit and I'll probably make it the official version.
I also added safari and chrome to the jsperf.