make-generator-function
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/make-generator-function package

2.0.0 • Public • Published

make-generator-function Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

Returns an arbitrary generator function, or undefined if generator syntax is unsupported. If both generator syntax and concise method syntax are supported, the generator function returned will have a "concise" property containing a concise generator method.

Example

var maybeGeneratorFunction = require('make-generator-function');
if (maybeGeneratorFunction) {
    assert(typeof maybeGeneratorFunction === 'function');
    var maybeConciseGeneratorMethod = maybeGeneratorFunction.concise;
    if (maybeConciseGeneratorMethod) {
        assert(typeof maybeConciseGeneratorMethod === 'function');
    }
} else {
    assert(typeof maybeGeneratorFunction === 'undefined');
}

Tests

Simply clone the repo, npm install, and run npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    2,637
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    2,637
  • 1.1.1
    142
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i make-generator-function

Weekly Downloads

2,779

Version

2.0.0

License

MIT

Unpacked Size

17.9 kB

Total Files

11

Last publish

Collaborators

  • ljharb