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

Package Sidebar

Install

npm i is-generator-fn

Weekly Downloads

20,563,816

Version

3.0.0

License

MIT

Unpacked Size

2.92 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus