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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    749
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    749
  • 2.1.0
    19,229,875
  • 2.0.0
    263,676
  • 1.0.0
    265,979

Package Sidebar

Install

npm i is-generator-fn

Weekly Downloads

15,896,330

Version

3.0.0

License

MIT

Unpacked Size

2.92 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus