Automatically add yield to generator calls.
$ npm install auto-yield
var autoYield = require('auto-yield')
var code = autoYield(`
function main () {
move()
}
function * move () {
yield 'moving'
}
`) =>
`function* main() {
yield move();
}
function* move() {
yield 'moving';
}`code- code to transformglobalGens- array of global names or object names that are generators or have generatorssecondOrderGens- array of functions that return generatorsuserFnNameOrGetter- string of call function wrapper or function determining call function wrapper string, function accepts one argument that is the name of the function node that is being called (path.node.callee.name).
Returns: transformed code
MIT