is-generator-fn

Check if something is a generator function

Usage no npm install needed!

<script type="module">
  import isGeneratorFn from 'https://cdn.skypack.dev/is-generator-fn';
</script>

README

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