diff --git a/index.js b/index.js index f7a4859..414e9f6 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,9 @@ var fnToStr = callBound('Function.prototype.toString'); var getGeneratorFunction = require('generator-function'); +// Hack to fix import, see https://github.com/inspect-js/is-generator-function/issues/45 +if (typeof getGeneratorFunction === 'object' && typeof getGeneratorFunction.default === 'function') getGeneratorFunction = getGeneratorFunction.default + /** @type {import('.')} */ module.exports = function isGeneratorFunction(fn) { if (typeof fn !== 'function') {