@torpor/view 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/compile.cjs +5 -2
- package/dist/compile.cjs.map +1 -1
- package/dist/compile.js +5 -2
- package/dist/compile.js.map +1 -1
- package/package.json +1 -1
- package/src/compile/build/client/addPushDevBoundary.ts +8 -5
- package/src/compile/build/client/replaceForVarNames.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/compile.cjs
CHANGED
|
@@ -92,7 +92,10 @@ function addPopDevBoundary(status, b) {
|
|
|
92
92
|
function addPushDevBoundary(type, name, status, b) {
|
|
93
93
|
if (status.options.dev === true) {
|
|
94
94
|
status.imports.add("t_push_dev_bound");
|
|
95
|
-
if (
|
|
95
|
+
if (name.startsWith("'") && name.endsWith("'") || name.startsWith("\"") && name.endsWith("\"") || name.startsWith("`") && name.endsWith("`")) {
|
|
96
|
+
const quote = name[0];
|
|
97
|
+
name = quote + name.substring(1, name.length - 1).replaceAll(quote, "\\" + quote) + quote;
|
|
98
|
+
} else name = `"${name.replaceAll("\"", "\\\"")}"`;
|
|
96
99
|
b.append(`t_push_dev_bound("${type}", ${name});`);
|
|
97
100
|
b.append("");
|
|
98
101
|
}
|
|
@@ -679,7 +682,7 @@ function printDebug(varName, status, b) {}
|
|
|
679
682
|
* Variables used within a for loop need to be retrieved from the loop data.
|
|
680
683
|
*/
|
|
681
684
|
function replaceForVarNames(value, status) {
|
|
682
|
-
for (let varName of status.forVarNames) value = value.replaceAll(new RegExp(`(^|\\s|\\(|\\[|\\{|!)${varName[0]}($|\\s
|
|
685
|
+
for (let varName of status.forVarNames) value = value.replaceAll(new RegExp(`(^|\\s|\\(|\\[|\\{|!)${varName[0]}($|\\s|\\.|,|\\(|\\)|\\[|\\]|\\}|;)`, "g"), `$1${varName[1]}$2`);
|
|
683
686
|
return value;
|
|
684
687
|
}
|
|
685
688
|
|