Sha256: a2883687c603b9dcdcf71c5ca3f50d229558830d5a7cee19fa73e1b50d836ab1

Contents?: true

Size: 963 Bytes

Versions: 7

Compression:

Stored size: 963 Bytes

Contents

import defineProvider from '@babel/helper-define-polyfill-provider';

const runtimeCompat = "#__secret_key__@babel/runtime__compatibility";
var index = defineProvider(({
  debug
}, options) => {
  const {
    [runtimeCompat]: {
      useBabelRuntime
    } = {}
  } = options;
  const pureName = useBabelRuntime ? `${useBabelRuntime}/regenerator` : "regenerator-runtime";
  return {
    name: "regenerator",
    polyfills: ["regenerator-runtime"],

    usageGlobal(meta, utils) {
      if (isRegenerator(meta)) {
        debug("regenerator-runtime");
        utils.injectGlobalImport("regenerator-runtime/runtime.js");
      }
    },

    usagePure(meta, utils, path) {
      if (isRegenerator(meta)) {
        path.replaceWith(utils.injectDefaultImport(pureName, "regenerator-runtime"));
      }
    }

  };
});

const isRegenerator = meta => meta.kind === "global" && meta.name === "regeneratorRuntime";

export default index;
//# sourceMappingURL=index.mjs.map

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.16.1 test/dummy/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs
disco_app-0.15.2 test/dummy/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs
disco_app-0.18.4 test/dummy/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs
disco_app-0.18.1 test/dummy/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs
disco_app-0.14.0 test/dummy/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs