Skip to content

Commit

Permalink
handle more than one property
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro committed Jun 8, 2024
1 parent 0a2cd88 commit 1c63d87
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/bindings/Babel.res
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ module PlaygroundValidator = {
switch (firstDeclaration.id, firstDeclaration.init) {
| (Identifier({name}), Some(init)) if name === "App" =>
switch init->Null.toOption {
| Some(ObjectExpression({
properties: [
ObjectProperty({
| Some(ObjectExpression({properties})) =>
let foundEntryPoint = properties->Array.find(property => {
switch property {
| ObjectProperty({
key: Identifier({name: "make"}),
value: Identifier({name: "Playground$App"}),
}),
],
})) =>
entryPoint.contents = true
}) => true
| _ => false
}
})
entryPoint.contents = Option.isSome(foundEntryPoint)
| _ => ()
}
| _ => ()
Expand Down

0 comments on commit 1c63d87

Please sign in to comment.