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
Holy shit that's genius!
But it only works up to a certain indent level...
Aside from that it seems to work with all the tests I did! :D