1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const generatorsAreSupported = (function () {
|
4 | try {
|
5 | eval('(function* () {})');
|
6 | return true;
|
7 | }
|
8 | catch (e) {
|
9 | return false;
|
10 | }
|
11 | })();
|
12 | const GeneratorFunction = (function () {
|
13 | if (!generatorsAreSupported)
|
14 | return;
|
15 | const func = eval('(function* () {})');
|
16 | return Object.getPrototypeOf(func).constructor;
|
17 | })();
|
18 | exports.default = (func) => generatorsAreSupported && func.constructor === GeneratorFunction;
|