@babel/template
Advanced tools
Comparing version 7.10.1 to 7.10.3
@@ -20,3 +20,3 @@ "use strict"; | ||
return { | ||
parser: Object.assign(Object.assign({}, a.parser), b.parser), | ||
parser: Object.assign({}, a.parser, b.parser), | ||
placeholderWhitelist, | ||
@@ -23,0 +23,0 @@ placeholderPattern, |
@@ -21,3 +21,2 @@ "use strict"; | ||
function parseAndBuildMetadata(formatter, code, opts) { | ||
const ast = parseWithCodeFrame(code, opts.parser); | ||
const { | ||
@@ -29,2 +28,3 @@ placeholderWhitelist, | ||
} = opts; | ||
const ast = parseWithCodeFrame(code, opts.parser, syntacticPlaceholders); | ||
t.removePropertiesDeep(ast, { | ||
@@ -152,9 +152,15 @@ preserveComments | ||
function parseWithCodeFrame(code, parserOpts) { | ||
parserOpts = Object.assign(Object.assign({ | ||
function parseWithCodeFrame(code, parserOpts, syntacticPlaceholders) { | ||
const plugins = (parserOpts.plugins || []).slice(); | ||
if (syntacticPlaceholders !== false) { | ||
plugins.push("placeholders"); | ||
} | ||
parserOpts = Object.assign({ | ||
allowReturnOutsideFunction: true, | ||
allowSuperOutsideMethod: true, | ||
sourceType: "module" | ||
}, parserOpts), {}, { | ||
plugins: (parserOpts.plugins || []).concat("placeholders") | ||
}, parserOpts, { | ||
plugins | ||
}); | ||
@@ -161,0 +167,0 @@ |
{ | ||
"name": "@babel/template", | ||
"version": "7.10.1", | ||
"version": "7.10.3", | ||
"description": "Generate an AST from a string template.", | ||
@@ -18,7 +18,7 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"dependencies": { | ||
"@babel/code-frame": "^7.10.1", | ||
"@babel/parser": "^7.10.1", | ||
"@babel/types": "^7.10.1" | ||
"@babel/code-frame": "^7.10.3", | ||
"@babel/parser": "^7.10.3", | ||
"@babel/types": "^7.10.3" | ||
}, | ||
"gitHead": "88f57a7ea659d25232bf62de1efceb5d6299b8cf" | ||
"gitHead": "2787ee2f967b6d8e1121fca00a8d578d75449a53" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
24231
569
1
Updated@babel/code-frame@^7.10.3
Updated@babel/parser@^7.10.3
Updated@babel/types@^7.10.3