JSPM

make-generator-function

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20547
  • Score
    100M100P100Q129130F
  • License MIT

Returns an arbitrary generator function, or undefined if generator syntax is unsupported.

Package Exports

  • make-generator-function

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (make-generator-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#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