Skip to content

Commit 077628a

Browse files
author
nicosammito
committed
feat: update return value handling in node function to ensure proper type casting
1 parent 07a2ff2 commit 077628a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export function getParameterCode(
152152
return `({} as ${refType})`;
153153
}
154154

155+
//TODO: need to distinguish between variant NODE and everything else
155156
if (value.__typename === "NodeFunctionIdWrapper") {
156157
const wrapperId = (value as NodeFunctionIdWrapper).id;
157158
const refNode = findNodeById(flow, wrapperId!);
@@ -168,7 +169,7 @@ export function getParameterCode(
168169
};
169170

170171
const returnNode = findReturnNode(refNode);
171-
if (!returnNode) return '(() => undefined)';
172+
if (!returnNode) return '(() => ({} as any))()';
172173

173174
const validation = getNodeValidation?.(flow, returnNode);
174175
return `(() => ({} as ${validation?.returnType}))`;

0 commit comments

Comments
 (0)