@babel/template
Advanced tools
Comparing version 7.24.7 to 7.25.0
@@ -101,5 +101,20 @@ "use strict"; | ||
} | ||
function set(parent, key, value) { | ||
const node = parent[key]; | ||
parent[key] = value; | ||
if (node.type === "Identifier") { | ||
if (node.typeAnnotation) { | ||
value.typeAnnotation = node.typeAnnotation; | ||
} | ||
if (node.optional) { | ||
value.optional = node.optional; | ||
} | ||
if (node.decorators) { | ||
value.decorators = node.decorators; | ||
} | ||
} | ||
} | ||
if (index === undefined) { | ||
validate(parent, key, replacement); | ||
parent[key] = replacement; | ||
set(parent, key, replacement); | ||
} else { | ||
@@ -113,6 +128,6 @@ const items = parent[key].slice(); | ||
} else { | ||
items[index] = replacement; | ||
set(items, index, replacement); | ||
} | ||
} else { | ||
items[index] = replacement; | ||
set(items, index, replacement); | ||
} | ||
@@ -119,0 +134,0 @@ validate(parent, key, items); |
{ | ||
"name": "@babel/template", | ||
"version": "7.24.7", | ||
"version": "7.25.0", | ||
"description": "Generate an AST from a string template.", | ||
@@ -20,4 +20,4 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"@babel/code-frame": "^7.24.7", | ||
"@babel/parser": "^7.24.7", | ||
"@babel/types": "^7.24.7" | ||
"@babel/parser": "^7.25.0", | ||
"@babel/types": "^7.25.0" | ||
}, | ||
@@ -24,0 +24,0 @@ "engines": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70356
597
Updated@babel/parser@^7.25.0
Updated@babel/types@^7.25.0