Sorry, that part of the code is from JSCrush which I did not write. I don't fully understand it but here's an explanation someone wrote...
https://nikhilism.com/post/2012/demystifying-jscrush
If you go to the live demo, it will do a test to crush/encodeURI and uncrush/decodeURI to the string you pass in and verify that they are the same. Maybe I should write some automated tests.