@lit/localize-tools
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -296,3 +296,3 @@ /** | ||
} | ||
return template; | ||
return newTemplate; | ||
} | ||
@@ -367,3 +367,15 @@ // We may have ended up with template expressions that can be represented | ||
}; | ||
for (const span of template.templateSpans) { | ||
for (let i = 0; i < template.templateSpans.length; i++) { | ||
const span = template.templateSpans[i]; | ||
// A span preceded by `=` can be an attribute so skip subsume and | ||
// keep it as an expression to produce valid lit-html template | ||
// TODO(augustinekim) Consider optimizing to regular quoted string for | ||
// regular html attributes | ||
if ((i === 0 | ||
? template.head.text | ||
: template.templateSpans[i - 1].literal.text).endsWith('=')) { | ||
fragments.push(ts.visitNode(span.expression, this.boundVisitNode)); | ||
fragments.push(span.literal.text); | ||
continue; | ||
} | ||
let expression = span.expression; | ||
@@ -370,0 +382,0 @@ // Can we directly subsume this span? |
{ | ||
"name": "@lit/localize-tools", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"publishConfig": { | ||
@@ -51,3 +51,3 @@ "access": "public" | ||
"devDependencies": { | ||
"@lit-labs/ssr": "^2.0.0", | ||
"@lit-labs/ssr": "^2.1.0", | ||
"@lit/ts-transformers": "^1.1.0", | ||
@@ -54,0 +54,0 @@ "@types/diff": "^5.0.0", |
@@ -451,3 +451,3 @@ /** | ||
} | ||
return template; | ||
return newTemplate; | ||
} | ||
@@ -538,3 +538,18 @@ | ||
for (const span of template.templateSpans) { | ||
for (let i = 0; i < template.templateSpans.length; i++) { | ||
const span = template.templateSpans[i]; | ||
// A span preceded by `=` can be an attribute so skip subsume and | ||
// keep it as an expression to produce valid lit-html template | ||
// TODO(augustinekim) Consider optimizing to regular quoted string for | ||
// regular html attributes | ||
if ( | ||
(i === 0 | ||
? template.head.text | ||
: template.templateSpans[i - 1].literal.text | ||
).endsWith('=') | ||
) { | ||
fragments.push(ts.visitNode(span.expression, this.boundVisitNode)); | ||
fragments.push(span.literal.text); | ||
continue; | ||
} | ||
let expression = span.expression; | ||
@@ -541,0 +556,0 @@ // Can we directly subsume this span? |
Sorry, the diff of this file is not supported yet
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
298908
6378
1