Skip to content

Change run_starlark_code to take additional arguments#3

Open
dcollien wants to merge 2 commits intoHarikrishnanBalagopal:mainfrom
dcollien:main
Open

Change run_starlark_code to take additional arguments#3
dcollien wants to merge 2 commits intoHarikrishnanBalagopal:mainfrom
dcollien:main

Conversation

@dcollien
Copy link

@dcollien dcollien commented Dec 13, 2024

This changes run_starlark_code to take in additional arguments:

const result = run_starlark_code(codeString, "functionName", more, arguments, here, to, pass, to, the, function);

It's backwards compatible with the original run_starlark_code which only takes a single argument. If given a single argument (just the code), it still runs the main function with no arguments.

It also converts any JSON-like arguments to starlark equivalents.

The second commit adds support for returnValue

console.log(result.returnValue);

…(string), and all other arguments passed to that function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant