df1be9061ee65c775f273663d7d05d40b9b4e89bc200eaca8662fa4da3dc995eb78bfd561cdc47c567f1dd488b07427e0ff650749547d2dfba6cec3c2bdfb3 1.7 KB

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