is-generator-function
Determine if a function is an ES6 generator function or not.
Last updated 9 years ago by ljharb .
MIT · Repository · Bugs · Original npm
$ cnpm install is-generator-function 
SYNC missed versions from official npm registry.

is-generator-function Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

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

Current Tags

  • 1.0.10                                ...           latest (4 years ago)

4 Versions

  • 1.0.10                                ...           4 years ago
  • 1.0.4                                ...           9 years ago
  • 1.0.8                                ...           5 years ago
  • 1.0.7                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org