Comparing version 0.0.25 to 0.0.26
# code-red changelog | ||
## 0.0.26 | ||
* Always replace comment values ([#20](https://github.com/Rich-Harris/code-red/pull/20)) | ||
## 0.0.25 | ||
@@ -4,0 +8,0 @@ |
@@ -1513,2 +1513,6 @@ (function (global, factory) { | ||
const inject = (raw, node, values, comments) => { | ||
comments.forEach(comment => { | ||
comment.value = comment.value.replace(re, (m, i) => +i in values ? values[+i] : m); | ||
}); | ||
estreeWalker.walk(node, { | ||
@@ -1555,16 +1559,2 @@ enter(node) { | ||
if (node.leadingComments) { | ||
node.leadingComments = node.leadingComments.map(c => ({ | ||
...c, | ||
value: c.value.replace(re, (m, i) => +i in values ? values[+i] : m) | ||
})); | ||
} | ||
if (node.trailingComments) { | ||
node.trailingComments = node.trailingComments.map(c => ({ | ||
...c, | ||
value: c.value.replace(re, (m, i) => +i in values ? values[+i] : m) | ||
})); | ||
} | ||
if (node.type === 'Literal') { | ||
@@ -1658,3 +1648,3 @@ if (typeof node.value === 'string') { | ||
try { | ||
const expression = acorn.parseExpressionAt(str, 0, acorn_opts(comments, str)) ; | ||
const expression = acorn.parseExpressionAt(str, 0, acorn_opts(comments, str)) ; | ||
@@ -1661,0 +1651,0 @@ inject(str, expression, values, comments); |
{ | ||
"name": "code-red", | ||
"description": "code-red", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"repository": "Rich-Harris/code-red", | ||
@@ -6,0 +6,0 @@ "main": "dist/code-red.js", |
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
78970
2760