source: trip-planner-front/node_modules/babel-plugin-polyfill-regenerator/lib/index.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1"use strict";
2
3exports.__esModule = true;
4exports.default = void 0;
5
6var _helperDefinePolyfillProvider = _interopRequireDefault(require("@babel/helper-define-polyfill-provider"));
7
8function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
10const runtimeCompat = "#__secret_key__@babel/runtime__compatibility";
11
12var _default = (0, _helperDefinePolyfillProvider.default)(({
13 debug
14}, options) => {
15 const {
16 [runtimeCompat]: {
17 useBabelRuntime
18 } = {}
19 } = options;
20 const pureName = useBabelRuntime ? `${useBabelRuntime}/regenerator` : "regenerator-runtime";
21 return {
22 name: "regenerator",
23 polyfills: ["regenerator-runtime"],
24
25 usageGlobal(meta, utils) {
26 if (isRegenerator(meta)) {
27 debug("regenerator-runtime");
28 utils.injectGlobalImport("regenerator-runtime/runtime.js");
29 }
30 },
31
32 usagePure(meta, utils, path) {
33 if (isRegenerator(meta)) {
34 path.replaceWith(utils.injectDefaultImport(pureName, "regenerator-runtime"));
35 }
36 }
37
38 };
39});
40
41exports.default = _default;
42
43const isRegenerator = meta => meta.kind === "global" && meta.name === "regeneratorRuntime";
Note: See TracBrowser for help on using the repository browser.