Skip to content

Commit 9a2fd5a

Browse files
committed
refactor: enhance node suggestion value handling in getNodeSuggestions.ts
1 parent cd40b40 commit 9a2fd5a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/suggestion/getNodeSuggestions.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const getNodeSuggestions = (
5858

5959

6060
return functionToSuggest?.map(f => {
61-
return {
61+
const node: NodeFunction = {
6262
__typename: "NodeFunction",
6363
id: `gid://sagittarius/NodeFunction/1`,
6464
functionDefinition: {
@@ -75,9 +75,13 @@ export const getNodeSuggestions = (
7575
id: p?.id,
7676
identifier: p?.identifier
7777
},
78-
value: null
78+
value: p?.defaultValue ? {
79+
__typename: "LiteralValue",
80+
value: p.defaultValue.value
81+
} : null
7982
}))
8083
}
81-
} as any as NodeFunction;
84+
}
85+
return node
8286
}).filter((f): f is NodeFunction => f !== null) ?? [];
8387
}

0 commit comments

Comments
 (0)