diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:31:11 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:31:11 +0800 |
| commit | aa773172311dcada759dfbaac485f4bc6e00bc21 (patch) | |
| tree | ca6d9a5eff3ab8f689f9acb4f0df791d9486813d /node_modules/@babel/plugin-transform-async-to-generator | |
| parent | c5a5384e846f242e901e859fe600d695d8990a9a (diff) | |
added babel
Diffstat (limited to 'node_modules/@babel/plugin-transform-async-to-generator')
5 files changed, 131 insertions, 0 deletions
diff --git a/node_modules/@babel/plugin-transform-async-to-generator/LICENSE b/node_modules/@babel/plugin-transform-async-to-generator/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/plugin-transform-async-to-generator/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie 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. diff --git a/node_modules/@babel/plugin-transform-async-to-generator/README.md b/node_modules/@babel/plugin-transform-async-to-generator/README.md new file mode 100644 index 00000000..d5d31e95 --- /dev/null +++ b/node_modules/@babel/plugin-transform-async-to-generator/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-async-to-generator + +> Turn async functions into ES2015 generators + +See our website [@babel/plugin-transform-async-to-generator](https://babeljs.io/docs/en/babel-plugin-transform-async-to-generator) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-async-to-generator +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-async-to-generator --dev +``` diff --git a/node_modules/@babel/plugin-transform-async-to-generator/lib/index.js b/node_modules/@babel/plugin-transform-async-to-generator/lib/index.js new file mode 100644 index 00000000..ec7f6c40 --- /dev/null +++ b/node_modules/@babel/plugin-transform-async-to-generator/lib/index.js @@ -0,0 +1,53 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _helperPluginUtils = require("@babel/helper-plugin-utils"); +var _helperRemapAsyncToGenerator = require("@babel/helper-remap-async-to-generator"); +var _helperModuleImports = require("@babel/helper-module-imports"); +var _core = require("@babel/core"); +var _default = (0, _helperPluginUtils.declare)((api, options) => { + var _api$assumption, _api$assumption2; + api.assertVersion(7); + const { + method, + module + } = options; + const noNewArrows = (_api$assumption = api.assumption("noNewArrows")) != null ? _api$assumption : true; + const ignoreFunctionLength = (_api$assumption2 = api.assumption("ignoreFunctionLength")) != null ? _api$assumption2 : false; + if (method && module) { + return { + name: "transform-async-to-generator", + visitor: { + Function(path, state) { + if (!path.node.async || path.node.generator) return; + let wrapAsync = state.methodWrapper; + if (wrapAsync) { + wrapAsync = _core.types.cloneNode(wrapAsync); + } else { + wrapAsync = state.methodWrapper = (0, _helperModuleImports.addNamed)(path, method, module); + } + (0, _helperRemapAsyncToGenerator.default)(path, { + wrapAsync + }, noNewArrows, ignoreFunctionLength); + } + } + }; + } + return { + name: "transform-async-to-generator", + visitor: { + Function(path, state) { + if (!path.node.async || path.node.generator) return; + (0, _helperRemapAsyncToGenerator.default)(path, { + wrapAsync: state.addHelper("asyncToGenerator") + }, noNewArrows, ignoreFunctionLength); + } + } + }; +}); +exports.default = _default; + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/plugin-transform-async-to-generator/lib/index.js.map b/node_modules/@babel/plugin-transform-async-to-generator/lib/index.js.map new file mode 100644 index 00000000..0c9eecea --- /dev/null +++ b/node_modules/@babel/plugin-transform-async-to-generator/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_helperPluginUtils","require","_helperRemapAsyncToGenerator","_helperModuleImports","_core","_default","declare","api","options","_api$assumption","_api$assumption2","assertVersion","method","module","noNewArrows","assumption","ignoreFunctionLength","name","visitor","Function","path","state","node","async","generator","wrapAsync","methodWrapper","t","cloneNode","addNamed","remapAsyncToGenerator","addHelper","exports","default"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport remapAsyncToGenerator from \"@babel/helper-remap-async-to-generator\";\nimport { addNamed } from \"@babel/helper-module-imports\";\nimport { types as t } from \"@babel/core\";\n\nexport interface Options {\n method?: string;\n module?: string;\n}\n\ntype State = {\n methodWrapper?: t.Identifier | t.SequenceExpression;\n};\n\nexport default declare<State>((api, options: Options) => {\n api.assertVersion(7);\n\n const { method, module } = options;\n // Todo(BABEL 8): Consider default it to false\n const noNewArrows = api.assumption(\"noNewArrows\") ?? true;\n const ignoreFunctionLength = api.assumption(\"ignoreFunctionLength\") ?? false;\n\n if (method && module) {\n return {\n name: \"transform-async-to-generator\",\n\n visitor: {\n Function(path, state) {\n if (!path.node.async || path.node.generator) return;\n\n let wrapAsync = state.methodWrapper;\n if (wrapAsync) {\n wrapAsync = t.cloneNode(wrapAsync);\n } else {\n wrapAsync = state.methodWrapper = addNamed(path, method, module);\n }\n\n remapAsyncToGenerator(\n path,\n { wrapAsync },\n noNewArrows,\n ignoreFunctionLength,\n );\n },\n },\n };\n }\n\n return {\n name: \"transform-async-to-generator\",\n\n visitor: {\n Function(path, state) {\n if (!path.node.async || path.node.generator) return;\n\n remapAsyncToGenerator(\n path,\n { wrapAsync: state.addHelper(\"asyncToGenerator\") },\n noNewArrows,\n ignoreFunctionLength,\n );\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAAyC,IAAAI,QAAA,GAW1B,IAAAC,0BAAO,EAAQ,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAAA,IAAAC,eAAA,EAAAC,gBAAA;EACvDH,GAAG,CAACI,aAAa,CAAC,CAAC,CAAC;EAEpB,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGL,OAAO;EAElC,MAAMM,WAAW,IAAAL,eAAA,GAAGF,GAAG,CAACQ,UAAU,CAAC,aAAa,CAAC,YAAAN,eAAA,GAAI,IAAI;EACzD,MAAMO,oBAAoB,IAAAN,gBAAA,GAAGH,GAAG,CAACQ,UAAU,CAAC,sBAAsB,CAAC,YAAAL,gBAAA,GAAI,KAAK;EAE5E,IAAIE,MAAM,IAAIC,MAAM,EAAE;IACpB,OAAO;MACLI,IAAI,EAAE,8BAA8B;MAEpCC,OAAO,EAAE;QACPC,QAAQA,CAACC,IAAI,EAAEC,KAAK,EAAE;UACpB,IAAI,CAACD,IAAI,CAACE,IAAI,CAACC,KAAK,IAAIH,IAAI,CAACE,IAAI,CAACE,SAAS,EAAE;UAE7C,IAAIC,SAAS,GAAGJ,KAAK,CAACK,aAAa;UACnC,IAAID,SAAS,EAAE;YACbA,SAAS,GAAGE,WAAC,CAACC,SAAS,CAACH,SAAS,CAAC;UACpC,CAAC,MAAM;YACLA,SAAS,GAAGJ,KAAK,CAACK,aAAa,GAAG,IAAAG,6BAAQ,EAACT,IAAI,EAAER,MAAM,EAAEC,MAAM,CAAC;UAClE;UAEA,IAAAiB,oCAAqB,EACnBV,IAAI,EACJ;YAAEK;UAAU,CAAC,EACbX,WAAW,EACXE,oBACF,CAAC;QACH;MACF;IACF,CAAC;EACH;EAEA,OAAO;IACLC,IAAI,EAAE,8BAA8B;IAEpCC,OAAO,EAAE;MACPC,QAAQA,CAACC,IAAI,EAAEC,KAAK,EAAE;QACpB,IAAI,CAACD,IAAI,CAACE,IAAI,CAACC,KAAK,IAAIH,IAAI,CAACE,IAAI,CAACE,SAAS,EAAE;QAE7C,IAAAM,oCAAqB,EACnBV,IAAI,EACJ;UAAEK,SAAS,EAAEJ,KAAK,CAACU,SAAS,CAAC,kBAAkB;QAAE,CAAC,EAClDjB,WAAW,EACXE,oBACF,CAAC;MACH;IACF;EACF,CAAC;AACH,CAAC,CAAC;AAAAgB,OAAA,CAAAC,OAAA,GAAA5B,QAAA"}
\ No newline at end of file diff --git a/node_modules/@babel/plugin-transform-async-to-generator/package.json b/node_modules/@babel/plugin-transform-async-to-generator/package.json new file mode 100644 index 00000000..68e1ba14 --- /dev/null +++ b/node_modules/@babel/plugin-transform-async-to-generator/package.json @@ -0,0 +1,36 @@ +{ + "name": "@babel/plugin-transform-async-to-generator", + "version": "7.22.5", + "description": "Turn async functions into ES2015 generators", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-plugin-transform-async-to-generator" + }, + "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-async-to-generator", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + }, + "devDependencies": { + "@babel/core": "^7.22.5", + "@babel/helper-plugin-test-runner": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "type": "commonjs" +}
\ No newline at end of file |
