初始化
This commit is contained in:
22
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/LICENSE
generated
vendored
Normal file
22
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Nicolò Ribaudo and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
28
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/README.md
generated
vendored
Normal file
28
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/README.md
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# babel-plugin-polyfill-regenerator
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev babel-plugin-polyfill-regenerator
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add babel-plugin-polyfill-regenerator --dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Add this plugin to your Babel configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": [["polyfill-regenerator", { "method": "usage-global" }]]
|
||||
}
|
||||
```
|
||||
|
||||
This package supports the `usage-pure`, `usage-global`, and `entry-global` methods.
|
||||
When `entry-global` is used, it replaces imports to `regenerator-runtime`.
|
||||
54
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs
generated
vendored
Normal file
54
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import defineProvider from '@babel/helper-define-polyfill-provider';
|
||||
|
||||
const runtimeCompat = "#__secret_key__@babel/runtime__compatibility";
|
||||
var index = defineProvider(({
|
||||
debug,
|
||||
targets,
|
||||
babel
|
||||
}, options) => {
|
||||
if (!shallowEqual(targets, babel.targets())) {
|
||||
throw new Error("This plugin does not use the targets option. Only preset-env's targets" + " or top-level targets need to be configured for this plugin to work." + " See https://github.com/babel/babel-polyfills/issues/36 for more" + " details.");
|
||||
}
|
||||
|
||||
const {
|
||||
[runtimeCompat]: {
|
||||
useBabelRuntime = false
|
||||
} = {}
|
||||
} = options;
|
||||
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)) {
|
||||
let pureName = "regenerator-runtime";
|
||||
|
||||
if (useBabelRuntime) {
|
||||
var _get;
|
||||
|
||||
const runtimeName = (_get = path.hub.file.get("runtimeHelpersModuleName")) != null ? _get : "@babel/runtime";
|
||||
pureName = `${runtimeName}/regenerator`;
|
||||
}
|
||||
|
||||
path.replaceWith(utils.injectDefaultImport(pureName, "regenerator-runtime"));
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
const isRegenerator = meta => meta.kind === "global" && meta.name === "regeneratorRuntime";
|
||||
|
||||
function shallowEqual(obj1, obj2) {
|
||||
return JSON.stringify(obj1) === JSON.stringify(obj2);
|
||||
}
|
||||
|
||||
export default index;
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs.map
generated
vendored
Normal file
1
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/esm/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import defineProvider from \"@babel/helper-define-polyfill-provider\";\nimport type { PluginPass } from \"@babel/core\";\n\nconst runtimeCompat = \"#__secret_key__@babel/runtime__compatibility\";\n\ntype Options = {\n \"#__secret_key__@babel/runtime__compatibility\": void | {\n useBabelRuntime: string;\n };\n};\n\nexport default defineProvider<Options>(({ debug, targets, babel }, options) => {\n if (!shallowEqual(targets, babel.targets())) {\n throw new Error(\n \"This plugin does not use the targets option. Only preset-env's targets\" +\n \" or top-level targets need to be configured for this plugin to work.\" +\n \" See https://github.com/babel/babel-polyfills/issues/36 for more\" +\n \" details.\",\n );\n }\n\n const { [runtimeCompat]: { useBabelRuntime = false } = {} } = options;\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 let pureName = \"regenerator-runtime\";\n if (useBabelRuntime) {\n const runtimeName =\n ((path.hub as any).file as PluginPass).get(\n \"runtimeHelpersModuleName\",\n ) ?? \"@babel/runtime\";\n pureName = `${runtimeName}/regenerator`;\n }\n\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\nfunction shallowEqual(obj1: any, obj2: any) {\n return JSON.stringify(obj1) === JSON.stringify(obj2);\n}\n"],"names":["runtimeCompat","defineProvider","debug","targets","babel","options","shallowEqual","Error","useBabelRuntime","name","polyfills","usageGlobal","meta","utils","isRegenerator","injectGlobalImport","usagePure","path","pureName","runtimeName","hub","file","get","replaceWith","injectDefaultImport","kind","obj1","obj2","JSON","stringify"],"mappings":";;AAGA,MAAMA,aAAa,GAAG,8CAAtB;AAQA,YAAeC,cAAc,CAAU,CAAC;EAAEC,KAAF;EAASC,OAAT;EAAkBC;AAAlB,CAAD,EAA4BC,OAA5B,KAAwC;EAC7E,IAAI,CAACC,YAAY,CAACH,OAAD,EAAUC,KAAK,CAACD,OAAN,EAAV,CAAjB,EAA6C;IAC3C,MAAM,IAAII,KAAJ,CACJ,2EACE,sEADF,GAEE,kEAFF,GAGE,WAJE,CAAN;;;EAQF,MAAM;IAAE,CAACP,aAAD,GAAiB;MAAEQ,eAAe,GAAG;QAAU;MAAOH,OAA9D;EAEA,OAAO;IACLI,IAAI,EAAE,aADD;IAGLC,SAAS,EAAE,CAAC,qBAAD,CAHN;;IAKLC,WAAW,CAACC,IAAD,EAAOC,KAAP,EAAc;MACvB,IAAIC,aAAa,CAACF,IAAD,CAAjB,EAAyB;QACvBV,KAAK,CAAC,qBAAD,CAAL;QACAW,KAAK,CAACE,kBAAN,CAAyB,gCAAzB;;KARC;;IAWLC,SAAS,CAACJ,IAAD,EAAOC,KAAP,EAAcI,IAAd,EAAoB;MAC3B,IAAIH,aAAa,CAACF,IAAD,CAAjB,EAAyB;QACvB,IAAIM,QAAQ,GAAG,qBAAf;;QACA,IAAIV,eAAJ,EAAqB;UAAA;;UACnB,MAAMW,WAAW,WACbF,IAAI,CAACG,GAAN,CAAkBC,IAAnB,CAAuCC,GAAvC,CACE,0BADF,CADe,mBAGV,gBAHP;UAIAJ,QAAQ,GAAI,GAAEC,WAAY,cAA1B;;;QAGFF,IAAI,CAACM,WAAL,CACEV,KAAK,CAACW,mBAAN,CAA0BN,QAA1B,EAAoC,qBAApC,CADF;;;;GAtBN;AA4BD,CAxC4B,CAA7B;;AA0CA,MAAMJ,aAAa,GAAGF,IAAI,IACxBA,IAAI,CAACa,IAAL,KAAc,QAAd,IAA0Bb,IAAI,CAACH,IAAL,KAAc,oBAD1C;;AAGA,SAASH,YAAT,CAAsBoB,IAAtB,EAAiCC,IAAjC,EAA4C;EAC1C,OAAOC,IAAI,CAACC,SAAL,CAAeH,IAAf,MAAyBE,IAAI,CAACC,SAAL,CAAeF,IAAf,CAAhC;AACD;;;;"}
|
||||
61
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/lib/index.js
generated
vendored
Normal file
61
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _helperDefinePolyfillProvider = _interopRequireDefault(require("@babel/helper-define-polyfill-provider"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const runtimeCompat = "#__secret_key__@babel/runtime__compatibility";
|
||||
|
||||
var _default = (0, _helperDefinePolyfillProvider.default)(({
|
||||
debug,
|
||||
targets,
|
||||
babel
|
||||
}, options) => {
|
||||
if (!shallowEqual(targets, babel.targets())) {
|
||||
throw new Error("This plugin does not use the targets option. Only preset-env's targets" + " or top-level targets need to be configured for this plugin to work." + " See https://github.com/babel/babel-polyfills/issues/36 for more" + " details.");
|
||||
}
|
||||
|
||||
const {
|
||||
[runtimeCompat]: {
|
||||
useBabelRuntime = false
|
||||
} = {}
|
||||
} = options;
|
||||
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)) {
|
||||
let pureName = "regenerator-runtime";
|
||||
|
||||
if (useBabelRuntime) {
|
||||
var _get;
|
||||
|
||||
const runtimeName = (_get = path.hub.file.get("runtimeHelpersModuleName")) != null ? _get : "@babel/runtime";
|
||||
pureName = `${runtimeName}/regenerator`;
|
||||
}
|
||||
|
||||
path.replaceWith(utils.injectDefaultImport(pureName, "regenerator-runtime"));
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = _default;
|
||||
|
||||
const isRegenerator = meta => meta.kind === "global" && meta.name === "regeneratorRuntime";
|
||||
|
||||
function shallowEqual(obj1, obj2) {
|
||||
return JSON.stringify(obj1) === JSON.stringify(obj2);
|
||||
}
|
||||
39
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/package.json
generated
vendored
Normal file
39
uni_modules/UniDevTools/node_modules/babel-plugin-polyfill-regenerator/package.json
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "babel-plugin-polyfill-regenerator",
|
||||
"version": "0.5.0",
|
||||
"description": "A Babel plugin to inject imports to regenerator-runtime",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel-polyfills.git",
|
||||
"directory": "packages/babel-plugin-polyfill-regenerator"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"import": "./esm/index.mjs",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"./lib/index.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-define-polyfill-provider": "^0.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.8",
|
||||
"@babel/helper-plugin-test-runner": "^7.16.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"gitHead": "391a1f4049fe1d6943ca8e91cf7e2e23f3f1ef73"
|
||||
}
|
||||
Reference in New Issue
Block a user