Ternary To Statement Converter (TTSC)

This tool was created with the purpose of assisting in reverse engineering javascript code. More specifically the "decompression" of ternaries to statements.

To decrease the size of any javascript code, it is compressed using various techniques. The resulting code still works like the original, but less packets are needed to transmit it in a network. This leads to a more difficult time of understanding the script though, as there is no indentation and no brackets.

This tool/function currently allows the accurate translation of nested and non-nested ternaries to statements. It even works with variables and return statements. There is only one thing which needs to be added: resolving brackets in a ternary statement.

Input (Ternary)

Output (Statement)