Skip to content

Commit cd40b40

Browse files
authored
Merge pull request #59 from code0-tech/feat/#58
If inputIndex and parameterIndex is present but null its falsely interpreted as an input parameter for reference values
2 parents 2797b40 + 01f2b55 commit cd40b40

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function generateFlowSourceCode(
124124
if (val.__typename === "ReferenceValue") {
125125
const ref = val as ReferenceValue;
126126
if (!ref.nodeFunctionId) return `/* @pos ${nodeId} ${paramIdx} */ undefined`;
127-
let refCode = ref.inputIndex !== undefined
127+
let refCode = typeof ref.inputIndex === "number"
128128
? `p_${sanitizeId(ref.nodeFunctionId)}_${ref.parameterIndex}[${ref.inputIndex}]`
129129
: `node_${sanitizeId(ref.nodeFunctionId)}`;
130130
ref.referencePath?.forEach(pathObj => {
@@ -174,7 +174,7 @@ export function generateFlowSourceCode(
174174
if (val.__typename === "ReferenceValue") {
175175
const ref = val as ReferenceValue;
176176
if (!ref.nodeFunctionId) return `/* @pos ${nodeId} ${index} */ undefined`;
177-
let refCode = ref.inputIndex !== undefined
177+
let refCode = typeof ref.inputIndex === "number"
178178
? `p_${sanitizeId(ref.nodeFunctionId)}_${ref.parameterIndex}[${ref.inputIndex}]`
179179
: `node_${sanitizeId(ref.nodeFunctionId)}`;
180180
ref.referencePath?.forEach(pathObj => {

0 commit comments

Comments
 (0)