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

1.0.10 • Public • Published

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

Package Sidebar

Install

npm i is-generator-function

Weekly Downloads

20,591,897

Version

1.0.10

License

MIT

Unpacked Size

31.9 kB

Total Files

12

Last publish

Collaborators

  • ljharb