index.js 367 B

1234567891011121314
  1. 'use strict';
  2. const {toString} = Object.prototype;
  3. module.exports = value => {
  4. if (typeof value !== 'function') {
  5. return false;
  6. }
  7. return (value.constructor && value.constructor.name === 'GeneratorFunction') ||
  8. toString.call(value) === '[object GeneratorFunction]';
  9. };
  10. // TODO: Remove this for the next major release
  11. module.exports.default = module.exports;