summaryrefslogtreecommitdiff
path: root/node_modules/@babel/helper-skip-transparent-expression-wrappers
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-10-14 15:31:11 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-10-14 15:31:11 +0800
commitaa773172311dcada759dfbaac485f4bc6e00bc21 (patch)
treeca6d9a5eff3ab8f689f9acb4f0df791d9486813d /node_modules/@babel/helper-skip-transparent-expression-wrappers
parentc5a5384e846f242e901e859fe600d695d8990a9a (diff)
added babel
Diffstat (limited to 'node_modules/@babel/helper-skip-transparent-expression-wrappers')
-rw-r--r--node_modules/@babel/helper-skip-transparent-expression-wrappers/LICENSE22
-rw-r--r--node_modules/@babel/helper-skip-transparent-expression-wrappers/README.md19
-rw-r--r--node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js34
-rw-r--r--node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js.map1
-rw-r--r--node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json30
5 files changed, 106 insertions, 0 deletions
diff --git a/node_modules/@babel/helper-skip-transparent-expression-wrappers/LICENSE b/node_modules/@babel/helper-skip-transparent-expression-wrappers/LICENSE
new file mode 100644
index 00000000..f31575ec
--- /dev/null
+++ b/node_modules/@babel/helper-skip-transparent-expression-wrappers/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/helper-skip-transparent-expression-wrappers/README.md b/node_modules/@babel/helper-skip-transparent-expression-wrappers/README.md
new file mode 100644
index 00000000..06ae3b7c
--- /dev/null
+++ b/node_modules/@babel/helper-skip-transparent-expression-wrappers/README.md
@@ -0,0 +1,19 @@
+# @babel/helper-skip-transparent-expression-wrappers
+
+> Helper which skips types and parentheses
+
+See our website [@babel/helper-skip-transparent-expression-wrappers](https://babeljs.io/docs/en/babel-helper-skip-transparent-expression-wrappers) for more information.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save @babel/helper-skip-transparent-expression-wrappers
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/helper-skip-transparent-expression-wrappers
+```
diff --git a/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js b/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js
new file mode 100644
index 00000000..151e7a51
--- /dev/null
+++ b/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js
@@ -0,0 +1,34 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.isTransparentExprWrapper = isTransparentExprWrapper;
+exports.skipTransparentExprWrapperNodes = skipTransparentExprWrapperNodes;
+exports.skipTransparentExprWrappers = skipTransparentExprWrappers;
+var _t = require("@babel/types");
+const {
+ isParenthesizedExpression,
+ isTSAsExpression,
+ isTSNonNullExpression,
+ isTSSatisfiesExpression,
+ isTSTypeAssertion,
+ isTypeCastExpression
+} = _t;
+function isTransparentExprWrapper(node) {
+ return isTSAsExpression(node) || isTSSatisfiesExpression(node) || isTSTypeAssertion(node) || isTSNonNullExpression(node) || isTypeCastExpression(node) || isParenthesizedExpression(node);
+}
+function skipTransparentExprWrappers(path) {
+ while (isTransparentExprWrapper(path.node)) {
+ path = path.get("expression");
+ }
+ return path;
+}
+function skipTransparentExprWrapperNodes(node) {
+ while (isTransparentExprWrapper(node)) {
+ node = node.expression;
+ }
+ return node;
+}
+
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js.map b/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js.map
new file mode 100644
index 00000000..9ac4ae3f
--- /dev/null
+++ b/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js.map
@@ -0,0 +1 @@
+{"version":3,"names":["_t","require","isParenthesizedExpression","isTSAsExpression","isTSNonNullExpression","isTSSatisfiesExpression","isTSTypeAssertion","isTypeCastExpression","isTransparentExprWrapper","node","skipTransparentExprWrappers","path","get","skipTransparentExprWrapperNodes","expression"],"sources":["../src/index.ts"],"sourcesContent":["import {\n isParenthesizedExpression,\n isTSAsExpression,\n isTSNonNullExpression,\n isTSSatisfiesExpression,\n isTSTypeAssertion,\n isTypeCastExpression,\n} from \"@babel/types\";\n\nimport type * as t from \"@babel/types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport type TransparentExprWrapper =\n | t.TSAsExpression\n | t.TSSatisfiesExpression\n | t.TSTypeAssertion\n | t.TSNonNullExpression\n | t.TypeCastExpression\n | t.ParenthesizedExpression;\n\n// A transparent expression wrapper is an AST node that most plugins will wish\n// to skip, as its presence does not affect the behaviour of the code. This\n// includes expressions used for types, and extra parenthesis. For example, in\n// (a as any)(), this helper can be used to skip the TSAsExpression when\n// determining the callee.\nexport function isTransparentExprWrapper(\n node: t.Node,\n): node is TransparentExprWrapper {\n return (\n isTSAsExpression(node) ||\n isTSSatisfiesExpression(node) ||\n isTSTypeAssertion(node) ||\n isTSNonNullExpression(node) ||\n isTypeCastExpression(node) ||\n isParenthesizedExpression(node)\n );\n}\n\nexport function skipTransparentExprWrappers(\n path: NodePath<t.Expression>,\n): NodePath<t.Expression> {\n while (isTransparentExprWrapper(path.node)) {\n path = path.get(\"expression\");\n }\n return path;\n}\n\nexport function skipTransparentExprWrapperNodes(\n node: t.Expression | t.Super,\n): t.Expression | t.Super {\n while (isTransparentExprWrapper(node)) {\n node = node.expression;\n }\n return node;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAOsB;EANpBC,yBAAyB;EACzBC,gBAAgB;EAChBC,qBAAqB;EACrBC,uBAAuB;EACvBC,iBAAiB;EACjBC;AAAoB,IAAAP,EAAA;AAmBf,SAASQ,wBAAwBA,CACtCC,IAAY,EACoB;EAChC,OACEN,gBAAgB,CAACM,IAAI,CAAC,IACtBJ,uBAAuB,CAACI,IAAI,CAAC,IAC7BH,iBAAiB,CAACG,IAAI,CAAC,IACvBL,qBAAqB,CAACK,IAAI,CAAC,IAC3BF,oBAAoB,CAACE,IAAI,CAAC,IAC1BP,yBAAyB,CAACO,IAAI,CAAC;AAEnC;AAEO,SAASC,2BAA2BA,CACzCC,IAA4B,EACJ;EACxB,OAAOH,wBAAwB,CAACG,IAAI,CAACF,IAAI,CAAC,EAAE;IAC1CE,IAAI,GAAGA,IAAI,CAACC,GAAG,CAAC,YAAY,CAAC;EAC/B;EACA,OAAOD,IAAI;AACb;AAEO,SAASE,+BAA+BA,CAC7CJ,IAA4B,EACJ;EACxB,OAAOD,wBAAwB,CAACC,IAAI,CAAC,EAAE;IACrCA,IAAI,GAAGA,IAAI,CAACK,UAAU;EACxB;EACA,OAAOL,IAAI;AACb"} \ No newline at end of file
diff --git a/node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json b/node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json
new file mode 100644
index 00000000..d4e675de
--- /dev/null
+++ b/node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json
@@ -0,0 +1,30 @@
+{
+ "name": "@babel/helper-skip-transparent-expression-wrappers",
+ "version": "7.22.5",
+ "description": "Helper which skips types and parentheses",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel.git",
+ "directory": "packages/babel-helper-skip-transparent-expression-wrappers"
+ },
+ "license": "MIT",
+ "publishConfig": {
+ "access": "public"
+ },
+ "main": "./lib/index.js",
+ "exports": {
+ ".": "./lib/index.js",
+ "./package.json": "./package.json"
+ },
+ "dependencies": {
+ "@babel/types": "^7.22.5"
+ },
+ "devDependencies": {
+ "@babel/traverse": "^7.22.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "author": "The Babel Team (https://babel.dev/team)",
+ "type": "commonjs"
+} \ No newline at end of file