is-generator-function
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • 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

/is-generator-function/

    Package Sidebar

    Install

    npm i is-generator-function

    Weekly Downloads

    31,117,891

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    35.7 kB

    Total Files

    13

    Last publish

    Collaborators

    • ljharb