1 | # is-generator-function <sup>[![Version Badge][2]][1]</sup>
|
---|
2 |
|
---|
3 | [![github actions][actions-image]][actions-url]
|
---|
4 | [![coverage][codecov-image]][codecov-url]
|
---|
5 | [![dependency status][5]][6]
|
---|
6 | [![dev dependency status][7]][8]
|
---|
7 | [![License][license-image]][license-url]
|
---|
8 | [![Downloads][downloads-image]][downloads-url]
|
---|
9 |
|
---|
10 | [![npm badge][11]][1]
|
---|
11 |
|
---|
12 | Is this a native generator function?
|
---|
13 |
|
---|
14 | ## Example
|
---|
15 |
|
---|
16 | ```js
|
---|
17 | var isGeneratorFunction = require('is-generator-function');
|
---|
18 | assert(!isGeneratorFunction(function () {}));
|
---|
19 | assert(!isGeneratorFunction(null));
|
---|
20 | assert(isGeneratorFunction(function* () { yield 42; return Infinity; }));
|
---|
21 | ```
|
---|
22 |
|
---|
23 | ## Tests
|
---|
24 | Simply clone the repo, `npm install`, and run `npm test`
|
---|
25 |
|
---|
26 | [1]: https://npmjs.org/package/is-generator-function
|
---|
27 | [2]: https://versionbadg.es/inspect-js/is-generator-function.svg
|
---|
28 | [5]: https://david-dm.org/inspect-js/is-generator-function.svg
|
---|
29 | [6]: https://david-dm.org/inspect-js/is-generator-function
|
---|
30 | [7]: https://david-dm.org/inspect-js/is-generator-function/dev-status.svg
|
---|
31 | [8]: https://david-dm.org/inspect-js/is-generator-function#info=devDependencies
|
---|
32 | [11]: https://nodei.co/npm/is-generator-function.png?downloads=true&stars=true
|
---|
33 | [license-image]: https://img.shields.io/npm/l/is-generator-function.svg
|
---|
34 | [license-url]: LICENSE
|
---|
35 | [downloads-image]: https://img.shields.io/npm/dm/is-generator-function.svg
|
---|
36 | [downloads-url]: https://npm-stat.com/charts.html?package=is-generator-function
|
---|
37 | [codecov-image]: https://codecov.io/gh/inspect-js/is-generator-function/branch/main/graphs/badge.svg
|
---|
38 | [codecov-url]: https://app.codecov.io/gh/inspect-js/is-generator-function/
|
---|
39 | [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-generator-function
|
---|
40 | [actions-url]: https://github.com/inspect-js/is-generator-function/actions
|
---|