Skip to content

Commit

Permalink
🚑 Fix inline code evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed May 24, 2024
1 parent b5d0ea4 commit 073c1d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/variables/parseVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ const evaluateInlineCode = (
{ variables }: { variables: Variable[] }
) => {
try {
const body = parseVariables(variables, { fieldToParse: 'id' })(code)
return createCodeRunner({ variables })(
parseVariables(variables, { fieldToParse: 'id' })(code)
body.includes('return ') ? body : `return ${body}`
)
} catch (err) {
return parseVariables(variables)(code)
Expand Down

0 comments on commit 073c1d4

Please sign in to comment.