Skip to content

Commit a1b8ff8

Browse files
committed
feat: update flowCode generation to include position comments for node settings
1 parent 3efa55e commit a1b8ff8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export function generateFlowSourceCode(
218218
if (p?.value?.__typename === "NodeFunctionIdWrapper" && p.value.id) subTreeIds.add(p.value.id);
219219
}));
220220

221-
const flowCode = flow ? `const flow_${sanitizeId(flow.id ?? "")} = flow(${flow.settings?.nodes?.map(setting => JSON.stringify(setting?.value)).join(", ")});` : ""
221+
const flowCode = flow ? `const flow_${sanitizeId(flow.id ?? "")} = flow(${flow.settings?.nodes?.map((setting, index) => `/* @pos undefined ${index} */ ${JSON.stringify(setting?.value)}`).join(", ") ?? ""});` : ""
222222

223223
const executionCode = nodes
224224
.filter(n => n?.id && !nextNodeIds.has(n.id) && !subTreeIds.has(n.id))

0 commit comments

Comments
 (0)