@reckona/mreact-compiler 0.0.70 → 0.0.72

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.
@@ -26,8 +26,7 @@ function emitOxcServerStringNode(node: JsxNodeIr): string {
26
26
  }
27
27
 
28
28
  if (node.kind === "list") {
29
- const parameters =
30
- node.indexName === undefined ? node.itemName : `${node.itemName}, ${node.indexName}`;
29
+ const parameters = emitOxcListParameters(node);
31
30
  return `(${node.itemsCode}).map((${parameters}) => ${emitOxcServerStringChildren(node.children)}).join("")`;
32
31
  }
33
32
 
@@ -104,8 +103,7 @@ function emitOxcCompatObjectNode(node: JsxNodeIr): string {
104
103
  }
105
104
 
106
105
  if (node.kind === "list") {
107
- const parameters =
108
- node.indexName === undefined ? node.itemName : `${node.itemName}, ${node.indexName}`;
106
+ const parameters = emitOxcListParameters(node);
109
107
  return `(${node.itemsCode}).map((${parameters}) => ${emitOxcCompatObjectChildren(node.children)})`;
110
108
  }
111
109
 
@@ -179,6 +177,12 @@ function emitOxcCompatObjectElement(
179
177
  ].join("\n");
180
178
  }
181
179
 
180
+ function emitOxcListParameters(node: Extract<JsxNodeIr, { kind: "list" }>): string {
181
+ return [node.itemName, node.indexName, node.arrayName]
182
+ .filter((name): name is string => name !== undefined)
183
+ .join(", ");
184
+ }
185
+
182
186
  function emitOxcCompatObjectAttribute(attr: AttributeIr): string {
183
187
  if (attr.kind === "spread-attr") {
184
188
  return `...(${attr.code})`;