1.0.0 • Published 6 years ago
is-gen-func v1.0.0
is-gen-func
Check if value is a generator function or an async generator function
Highlights
- Written in Typescript 
- Supports async and sync generator functions 
Installation
npm:
$ npm install is-gen-funcyarn:
$ yarn add is-gen-funcUsage
Check if value is a generator function
  const { isGenFunc } = require('is-gen-func');
  isGenFunc(function *() {
    return 'hello world';
  });
  //=> true
  isGenFunc(function () {
    return 'hello world';
  });
  //=> false
  isGenFunc(async function *() {
    return 'hello world';
  });
  //=> true
  isGenFunc(async function () {
    return 'hello world';
  });
  //=> falseLicense
MIT © Nivrith
1.0.0
6 years ago