Transpile these ES6 arrow functions!
JavaScript (ES6), 123 110 100 97 bytes

Saved 3 bytes thanks to @Neil

s=&gt;s.replace(/\(?(.*?)\)?\s*=&gt;\s*([^]*)/,(_,a,b)=&gt;`function(${a})${b[0]=='{'?b:`{return ${b}}`}`)


Assumes the input is a syntactically valid arrow function and nothing else. Correctly handles the case a =&gt;\na, though not handling is not any shorter as far as I can tell.

Output when the code is run through itself:

function(s){return s.replace(/\(?(.*?)\)?\s*=&gt;\s*([^]*)/,(_,a,b)=&gt;`function(${a})${b[0]=='{'?b:`{return ${b}}`}`)}




I can save 9 bytes with a possibly invalid format:

s=&gt;s.replace(/\(?(.*?)\)?\s*=&gt;\s*({?)([^]*?)}?$/,(_,a,z,b)=&gt;Function(a,z?b:'return '+b))


Output for itself:

function anonymous(s) {
return s.replace(/\(?([^=)]*)\)?\s*=&gt;\s*({?)([^]*?)}?$/,(_,a,z,b)=&gt;Function(a,z?b:'return '+b))
}


(Specifically, the function anonymous is what I'm worried about.)