npm

Need private packages and team management tools?Check out npm Orgs. »

make-generator-function

1.1.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

install

npm i make-generator-function

Downloadsweekly downloads

230

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability