@torpor/view 0.4.1 → 0.4.3

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @torpor/view
2
2
 
3
+ ## 0.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 00a1868: Fix: escape quotes in dev boundary names
8
+
9
+ ## 0.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - d1bc0cc: Fix: ensure that dev context is always in scope
14
+
3
15
  ## 0.4.1
4
16
 
5
17
  ### Patch Changes
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 (!(name.startsWith("'") && name.endsWith("'") || name.startsWith("\"") && name.endsWith("\"") || name.startsWith("`") || name.endsWith("`"))) name = `"${name}"`;
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
  }