0.9.2 • Published 2 years ago

auto-yield-delegate v0.9.2

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

auto-yield

Git tag NPM version

Automatically add yield to generator calls.

Installation

$ npm install auto-yield

Usage

var autoYield = require('auto-yield')

var code = autoYield(`
function main () {
  move()
}

function * move () {
  yield 'moving'
}
`) =>

`function* main() {
yield move();
}

function* move() {
yield 'moving';
}`

API

autoYield(code, globalGens, secondOrderGens, userFnNameOrGetter)

  • code - code to transform
  • globalGens - array of global names or object names that are generators or have generators
  • secondOrderGens - array of functions that return generators
  • userFnNameOrGetter - 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

License

MIT

0.9.2

2 years ago

0.9.0

3 years ago

0.9.1

3 years ago

0.8.0

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.4

8 years ago

0.5.3

8 years ago