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

3.0.0 • Public • Published

is-generator-fn

Check if something is a generator function

Install

$ npm install is-generator-fn

Usage

import isGeneratorFunction from 'is-generator-fn';

isGeneratorFunction(function * () {});
//=> true

isGeneratorFunction(function () {});
//=> false

Related

  • is - Type check values

/is-generator-fn/

    Package Sidebar

    Install

    npm i is-generator-fn

    Weekly Downloads

    19,360,174

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    2.92 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus