Skip to content

Check if something is a generator function

License

Notifications You must be signed in to change notification settings

sindresorhus/is-generator-fn

Repository files navigation

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