Initial import of is-generator-function


Change-Id: I328570a8971fc4cdfdf762d0f87e5600c5cdced0
14 files changed
tree: 593fd815fdcd65427243a2428e79c6023eec1d85
  1. test/
  2. .eslintrc
  3. .gitignore
  4. .npmrc
  5. .nvmrc
  6. .nycrc
  7. CHANGELOG.md
  8. index.js
  9. LICENSE
  10. METADATA
  11. package.json
  12. README.md
README.md

is-generator-function Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this a native generator function?

Example

var isGeneratorFunction = require('is-generator-function');
assert(!isGeneratorFunction(function () {}));
assert(!isGeneratorFunction(null));
assert(isGeneratorFunction(function* () { yield 42; return Infinity; }));

Tests

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