Open tmartensen opened 6 years ago
Ok, I can work around it by prefixing any args with async
to the identifier i'm using. For example:
j.arrowFunctionExpression(
[j.identifier("async args")],
body
)
But that doesn't feel right. Any help/advice would be appreciated. Thanks!
Found another way to do it. It's easy to set the above code to a variable, and add async
after the initialization:
const arrowFunc = j.arrowFunctionExpression(
[j.identifier("args")],
body
)
arrowFunc.async = true
thanks
arrowFunc.callee.async = true
actually
Is it possible to create an async ArrowFunctionExpression? I'm using
jscodeshift
to modify some code, and I need to create a variable declaration with this signature:const doSomethingAsync = async args => { await ... }