is-gen-func
v1.0.0
Published
Check if value is a generator function
Downloads
1
Readme
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-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