Skip to content

Commit

Permalink
lil fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gnlow committed Oct 8, 2023
1 parent ab63041 commit defd460
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/util/projectToJs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ export const projectToJs =
(project: Project) =>
project.objects.map(
objectToExpressions
).join("\n")
).flat().join("\n")

export const objectToExpressions =
({script, id}: Object_) =>
scriptToExpressions(script).join("\n").replaceAll(`$obj$`, id)
scriptToExpressions(script)
.map(expression => expression.replaceAll(`$obj$`, id) as Expression)

export const scriptToExpressions =
(script: Script) =>
script .map(eventHandlerToFunction)
script
.map(eventHandlerToFunction)
.filter((x): x is Expression => !!x)

export const paramsToExpressions =
Expand Down

0 comments on commit defd460

Please sign in to comment.