Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function convertToFlow(path, state) {
if (
isAnyFunctionExpression(path.node) &&
path.node.async &&
t.isBlockStatement(path.get('body').node)
) {
remapAsyncToGenerator(path, state.file, {
wrapAsync: state.addImport(state.mobxPackage, "flow")
});
}
}
Function(path, state) {
if (!path.node.async || path.node.generator) return;
remapAsyncToGenerator(
path,
t.memberExpression(state.addImport("bluebird", null, "absolute"), t.identifier("coroutine"))
);
}
}