@babel/plugin-transform-optional-catch-binding 7.22.5 → 8.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/index.js +5 -10
- package/lib/index.js.map +1 -1
- package/package.json +11 -7
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Compile optional catch bindings
|
|
4
4
|
|
|
5
|
-
See our website [@babel/plugin-transform-optional-catch-binding](https://babeljs.io/docs/
|
|
5
|
+
See our website [@babel/plugin-transform-optional-catch-binding](https://babeljs.io/docs/babel-plugin-transform-optional-catch-binding) for more information.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
package/lib/index.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { declare } from '@babel/helper-plugin-utils';
|
|
2
|
+
import syntaxOptionalCatchBinding from '@babel/plugin-syntax-optional-catch-binding';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
|
8
|
-
var _pluginSyntaxOptionalCatchBinding = require("@babel/plugin-syntax-optional-catch-binding");
|
|
9
|
-
var _default = (0, _helperPluginUtils.declare)(api => {
|
|
4
|
+
var index = declare(api => {
|
|
10
5
|
api.assertVersion(7);
|
|
11
6
|
return {
|
|
12
7
|
name: "transform-optional-catch-binding",
|
|
13
|
-
inherits:
|
|
8
|
+
inherits: syntaxOptionalCatchBinding.default,
|
|
14
9
|
visitor: {
|
|
15
10
|
CatchClause(path) {
|
|
16
11
|
if (!path.node.param) {
|
|
@@ -22,6 +17,6 @@ var _default = (0, _helperPluginUtils.declare)(api => {
|
|
|
22
17
|
}
|
|
23
18
|
};
|
|
24
19
|
});
|
|
25
|
-
exports.default = _default;
|
|
26
20
|
|
|
21
|
+
export { index as default };
|
|
27
22
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxOptionalCatchBinding from \"@babel/plugin-syntax-optional-catch-binding\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-optional-catch-binding\",\n inherits: syntaxOptionalCatchBinding.default,\n\n visitor: {\n CatchClause(path) {\n if (!path.node.param) {\n const uid = path.scope.generateUidIdentifier(\"unused\");\n const paramPath = path.get(\"param\");\n paramPath.replaceWith(uid);\n }\n },\n },\n };\n});\n"],"names":["declare","api","assertVersion","name","inherits","syntaxOptionalCatchBinding","default","visitor","CatchClause","path","node","param","uid","scope","generateUidIdentifier","paramPath","get","replaceWith"],"mappings":";;;AAGA,YAAeA,OAAO,CAACC,GAAG,IAAI;AAC5BA,EAAAA,GAAG,CAACC,aAAa,CAAC,CAAC,CAAC,CAAA;EAEpB,OAAO;AACLC,IAAAA,IAAI,EAAE,kCAAkC;IACxCC,QAAQ,EAAEC,0BAA0B,CAACC,OAAO;AAE5CC,IAAAA,OAAO,EAAE;MACPC,WAAWA,CAACC,IAAI,EAAE;AAChB,QAAA,IAAI,CAACA,IAAI,CAACC,IAAI,CAACC,KAAK,EAAE;UACpB,MAAMC,GAAG,GAAGH,IAAI,CAACI,KAAK,CAACC,qBAAqB,CAAC,QAAQ,CAAC,CAAA;AACtD,UAAA,MAAMC,SAAS,GAAGN,IAAI,CAACO,GAAG,CAAC,OAAO,CAAC,CAAA;AACnCD,UAAAA,SAAS,CAACE,WAAW,CAACL,GAAG,CAAC,CAAA;AAC5B,SAAA;AACF,OAAA;AACF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babel/plugin-transform-optional-catch-binding",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.0",
|
|
4
4
|
"description": "Compile optional catch bindings",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,19 +17,23 @@
|
|
|
17
17
|
"babel-plugin"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@babel/helper-plugin-utils": "^
|
|
20
|
+
"@babel/helper-plugin-utils": "^8.0.0-alpha.0",
|
|
21
21
|
"@babel/plugin-syntax-optional-catch-binding": "^7.8.3"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@babel/core": "^
|
|
24
|
+
"@babel/core": "^8.0.0-alpha.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babel/core": "^
|
|
28
|
-
"@babel/helper-plugin-test-runner": "^
|
|
27
|
+
"@babel/core": "^8.0.0-alpha.0",
|
|
28
|
+
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.0"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
31
|
+
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
|
|
32
32
|
},
|
|
33
33
|
"author": "The Babel Team (https://babel.dev/team)",
|
|
34
|
-
"
|
|
34
|
+
"exports": {
|
|
35
|
+
".": "./lib/index.js",
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"type": "module"
|
|
35
39
|
}
|