You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
2.1 KiB

{"version":3,"file":"index.mjs","sources":["../src/index.js"],"sourcesContent":["// @flow\n\nimport defineProvider from \"@babel/helper-define-polyfill-provider\";\n\nconst runtimeCompat = \"#__secret_key__@babel/runtime__compatibility\";\n\nexport default defineProvider(({ debug }, options) => {\n const { [runtimeCompat]: { useBabelRuntime } = {} } = options;\n\n const pureName = useBabelRuntime\n ? `${useBabelRuntime}/regenerator`\n : \"regenerator-runtime\";\n\n return {\n name: \"regenerator\",\n\n polyfills: [\"regenerator-runtime\"],\n\n usageGlobal(meta, utils) {\n if (isRegenerator(meta)) {\n debug(\"regenerator-runtime\");\n utils.injectGlobalImport(\"regenerator-runtime/runtime.js\");\n }\n },\n usagePure(meta, utils, path) {\n if (isRegenerator(meta)) {\n path.replaceWith(\n utils.injectDefaultImport(pureName, \"regenerator-runtime\"),\n );\n }\n },\n };\n});\n\nconst isRegenerator = meta =>\n meta.kind === \"global\" && meta.name === \"regeneratorRuntime\";\n"],"names":["runtimeCompat","defineProvider","debug","options","useBabelRuntime","pureName","name","polyfills","usageGlobal","meta","utils","isRegenerator","injectGlobalImport","usagePure","path","replaceWith","injectDefaultImport","kind"],"mappings":";;AAIA,MAAMA,aAAa,GAAG,8CAAtB;AAEA,YAAeC,cAAc,CAAC,CAAC;AAAEC,EAAAA;AAAF,CAAD,EAAYC,OAAZ,KAAwB;AACpD,QAAM;AAAE,KAACH,aAAD,GAAiB;AAAEI,MAAAA;AAAF,QAAsB;AAAzC,MAAgDD,OAAtD;AAEA,QAAME,QAAQ,GAAGD,eAAe,GAC3B,GAAEA,eAAgB,cADS,GAE5B,qBAFJ;AAIA,SAAO;AACLE,IAAAA,IAAI,EAAE,aADD;AAGLC,IAAAA,SAAS,EAAE,CAAC,qBAAD,CAHN;;AAKLC,IAAAA,WAAW,CAACC,IAAD,EAAOC,KAAP,EAAc;AACvB,UAAIC,aAAa,CAACF,IAAD,CAAjB,EAAyB;AACvBP,QAAAA,KAAK,CAAC,qBAAD,CAAL;AACAQ,QAAAA,KAAK,CAACE,kBAAN,CAAyB,gCAAzB;AACD;AACF,KAVI;;AAWLC,IAAAA,SAAS,CAACJ,IAAD,EAAOC,KAAP,EAAcI,IAAd,EAAoB;AAC3B,UAAIH,aAAa,CAACF,IAAD,CAAjB,EAAyB;AACvBK,QAAAA,IAAI,CAACC,WAAL,CACEL,KAAK,CAACM,mBAAN,CAA0BX,QAA1B,EAAoC,qBAApC,CADF;AAGD;AACF;;AAjBI,GAAP;AAmBD,CA1B4B,CAA7B;;AA4BA,MAAMM,aAAa,GAAGF,IAAI,IACxBA,IAAI,CAACQ,IAAL,KAAc,QAAd,IAA0BR,IAAI,CAACH,IAAL,KAAc,oBAD1C;;;;"}