hexo/node_modules/@babel/plugin-transform-regenerator/lib/index.js.map

1 line
2.4 KiB
Plaintext

{"version":3,"names":["declare","types","t","assertVersion","name","inherits","regeneratorTransform","default","visitor","MemberExpression","path","availableHelper","obj","get","isIdentifier","helper","addHelper","isArrowFunctionExpression","replaceWith","body","callExpression"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport type { types as t } from \"@babel/core\";\nimport regeneratorTransform from \"regenerator-transform\";\n\nexport default declare(({ types: t, assertVersion }) => {\n assertVersion(7);\n\n return {\n name: \"transform-regenerator\",\n\n inherits: regeneratorTransform.default,\n\n visitor: {\n // We visit MemberExpression so that we always transform\n // regeneratorRuntime before babel-plugin-polyfill-regenerator.\n MemberExpression(path) {\n if (!this.availableHelper?.(\"regeneratorRuntime\")) {\n // When using an older @babel/helpers version, fallback\n // to the old behavior.\n // TODO: Remove this in Babel 8.\n return;\n }\n\n const obj = path.get(\"object\");\n if (obj.isIdentifier({ name: \"regeneratorRuntime\" })) {\n const helper = this.addHelper(\"regeneratorRuntime\") as\n | t.Identifier\n | t.ArrowFunctionExpression;\n\n if (\n // TODO: Remove this in Babel 8, it's necessary to\n // avoid the IIFE when using older Babel versions.\n t.isArrowFunctionExpression(helper)\n ) {\n obj.replaceWith(helper.body);\n return;\n }\n\n obj.replaceWith(t.callExpression(helper, []));\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA;AAEA;AAAyD,eAE1C,IAAAA,0BAAO,EAAC,CAAC;EAAEC,KAAK,EAAEC,CAAC;EAAEC;AAAc,CAAC,KAAK;EACtDA,aAAa,CAAC,CAAC,CAAC;EAEhB,OAAO;IACLC,IAAI,EAAE,uBAAuB;IAE7BC,QAAQ,EAAEC,qBAAoB,CAACC,OAAO;IAEtCC,OAAO,EAAE;MAGPC,gBAAgB,CAACC,IAAI,EAAE;QAAA;QACrB,IAAI,2BAAC,IAAI,CAACC,eAAe,aAApB,+BAAI,EAAmB,oBAAoB,CAAC,GAAE;UAIjD;QACF;QAEA,MAAMC,GAAG,GAAGF,IAAI,CAACG,GAAG,CAAC,QAAQ,CAAC;QAC9B,IAAID,GAAG,CAACE,YAAY,CAAC;UAAEV,IAAI,EAAE;QAAqB,CAAC,CAAC,EAAE;UACpD,MAAMW,MAAM,GAAG,IAAI,CAACC,SAAS,CAAC,oBAAoB,CAErB;UAE7B;UAGEd,CAAC,CAACe,yBAAyB,CAACF,MAAM,CAAC,EACnC;YACAH,GAAG,CAACM,WAAW,CAACH,MAAM,CAACI,IAAI,CAAC;YAC5B;UACF;UAEAP,GAAG,CAACM,WAAW,CAAChB,CAAC,CAACkB,cAAc,CAACL,MAAM,EAAE,EAAE,CAAC,CAAC;QAC/C;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC;AAAA"}