is-gen-func
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

is-gen-func

CircleCI NPM Downloads node License MIT

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-func

yarn:

$ yarn add is-gen-func

Usage

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';
  });
  //=> false

License

MIT © Nivrith

Readme

Keywords

Package Sidebar

Install

npm i is-gen-func

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

165 kB

Total Files

10

Last publish

Collaborators

  • nivrith