@babel/traverse
Advanced tools
@@ -166,3 +166,3 @@ "use strict"; | ||
| this.path.replaceWith(cloneNode(uid)); | ||
| return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init"); | ||
| return attached.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init"); | ||
| } | ||
@@ -169,0 +169,0 @@ } |
@@ -55,4 +55,4 @@ "use strict"; | ||
| const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null); | ||
| this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : [])); | ||
| return this.unshiftContainer("body", nodes); | ||
| const [blockPath] = this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : [])); | ||
| return blockPath.unshiftContainer("body", nodes); | ||
| } else { | ||
@@ -157,4 +157,4 @@ throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); | ||
| const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null); | ||
| this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : [])); | ||
| return this.pushContainer("body", nodes); | ||
| const [blockPath] = this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : [])); | ||
| return blockPath.pushContainer("body", nodes); | ||
| } else { | ||
@@ -202,11 +202,12 @@ throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); | ||
| _removal._assertUnremoved.call(this); | ||
| nodes = _verifyNodeList.call(this, nodes); | ||
| const verifiedNodes = _verifyNodeList.call(this, nodes); | ||
| const container = this.node[listKey]; | ||
| const path = _index.default.get({ | ||
| parentPath: this, | ||
| parent: this.node, | ||
| container: this.node[listKey], | ||
| container, | ||
| listKey, | ||
| key: 0 | ||
| }).setContext(this.context); | ||
| return _containerInsertBefore.call(path, nodes); | ||
| return _containerInsertBefore.call(path, verifiedNodes); | ||
| } | ||
@@ -220,3 +221,3 @@ function pushContainer(listKey, nodes) { | ||
| parent: this.node, | ||
| container: container, | ||
| container, | ||
| listKey, | ||
@@ -223,0 +224,0 @@ key: container.length |
@@ -53,5 +53,5 @@ "use strict"; | ||
| _context.resync.call(this); | ||
| nodes = _modification._verifyNodeList.call(this, nodes); | ||
| inheritLeadingComments(nodes[0], this.node); | ||
| inheritTrailingComments(nodes[nodes.length - 1], this.node); | ||
| const verifiedNodes = _modification._verifyNodeList.call(this, nodes); | ||
| inheritLeadingComments(verifiedNodes[0], this.node); | ||
| inheritTrailingComments(verifiedNodes[verifiedNodes.length - 1], this.node); | ||
| (_getCachedPaths = (0, _cache.getCachedPaths)(this)) == null || _getCachedPaths.delete(this.node); | ||
@@ -58,0 +58,0 @@ this.node = this.container[this.key] = null; |
+1
-1
@@ -107,3 +107,3 @@ "use strict"; | ||
| if (!TYPES.includes(nodeType)) { | ||
| throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${"7.28.3"}`); | ||
| throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${"7.28.4"}`); | ||
| } | ||
@@ -110,0 +110,0 @@ const visitors = visitor[nodeType]; |
+4
-4
| { | ||
| "name": "@babel/traverse", | ||
| "version": "7.28.3", | ||
| "version": "7.28.4", | ||
| "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", | ||
@@ -22,9 +22,9 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
| "@babel/helper-globals": "^7.28.0", | ||
| "@babel/parser": "^7.28.3", | ||
| "@babel/parser": "^7.28.4", | ||
| "@babel/template": "^7.27.2", | ||
| "@babel/types": "^7.28.2", | ||
| "@babel/types": "^7.28.4", | ||
| "debug": "^4.3.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^7.28.3", | ||
| "@babel/core": "^7.28.4", | ||
| "@babel/helper-plugin-test-runner": "^7.27.1" | ||
@@ -31,0 +31,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
695375
0.17%5809
0.02%Updated
Updated