Skip to content

Commit

Permalink
module that exports only the function (#78)
Browse files Browse the repository at this point in the history
fixes: #77
  • Loading branch information
hrgdavor authored Jan 17, 2024
1 parent 5fe1cd8 commit a75f42d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/worker/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ const runScript = async ({ script, url, base=globalBase, root=base }) => {
const fromSource = getParameterDefinitionsFromSource(script)
def = combineParameterDefinitions(fromSource, await scriptModule.getParameterDefinitions?.())
main = scriptModule.main
// if the main function is the default export
if(!main && typeof scriptModule == 'function') main = scriptModule
let out = await runMain({ params: extractDefaults(def) })
out.def = def
return out
Expand Down

0 comments on commit a75f42d

Please sign in to comment.