I have this GorillaScript code to flatten arrays:
Array::compact := #
for filter value in this
value and (typeof value.isempty != 'function' or not value.isempty()) and (typeof value != 'object' or Object.keys(value).length != 0)
GorillaScript is kinda dead. Could someone translate this into LiveScript for me please? I'm quite new to LiveScript.
A literal translation would look something like this.
A more idiomatic example might be:
Watch out, as this was done off the top of my head any my LiveScript's a bit rusty, but the general ideas here are ok.