@babel/plugin-transform-optional-chaining 8.1.4 → 8.1.5

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.
Files changed (2) hide show
  1. package/lib/index.js +4 -2
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -201,9 +201,11 @@ function transform(path, assumptions) {
201
201
  transformOptionalChain(path, assumptions, parentPath, types.booleanLiteral(true));
202
202
  } else {
203
203
  let wrapLast;
204
- if (parentPath.isCallExpression({
204
+ if ((parentPath.isCallExpression({
205
205
  callee: maybeWrapped.node
206
- }) && path.isOptionalMemberExpression()) {
206
+ }) || parentPath.isTaggedTemplateExpression({
207
+ tag: maybeWrapped.node
208
+ })) && path.isOptionalMemberExpression()) {
207
209
  wrapLast = replacement => {
208
210
  const object = skipTransparentExprWrapperNodes(replacement.object);
209
211
  let baseRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/plugin-transform-optional-chaining",
3
- "version": "8.1.4",
3
+ "version": "8.1.5",
4
4
  "description": "Transform optional chaining operators into a series of nil checks",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,17 +17,17 @@
17
17
  "babel-plugin"
18
18
  ],
19
19
  "dependencies": {
20
- "@babel/helper-plugin-utils": "^8.0.1",
21
- "@babel/helper-skip-transparent-expression-wrappers": "^8.1.0"
20
+ "@babel/helper-plugin-utils": "^8.1.5",
21
+ "@babel/helper-skip-transparent-expression-wrappers": "^8.1.5"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@babel/core": "^8.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@babel/core": "^8.1.4",
28
- "@babel/helper-plugin-test-runner": "^8.0.0",
29
- "@babel/plugin-transform-block-scoping": "^8.1.4",
30
- "@babel/traverse": "^8.1.4"
27
+ "@babel/core": "^8.1.5",
28
+ "@babel/helper-plugin-test-runner": "^8.1.5",
29
+ "@babel/plugin-transform-block-scoping": "^8.1.5",
30
+ "@babel/traverse": "^8.1.5"
31
31
  },
32
32
  "engines": {
33
33
  "node": "^22.18.0 || >=24.11.0"