Skip to content

Commit 1c63d87

Browse files
committed
handle more than one property
1 parent 0a2cd88 commit 1c63d87

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/bindings/Babel.res

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,17 @@ module PlaygroundValidator = {
5959
switch (firstDeclaration.id, firstDeclaration.init) {
6060
| (Identifier({name}), Some(init)) if name === "App" =>
6161
switch init->Null.toOption {
62-
| Some(ObjectExpression({
63-
properties: [
64-
ObjectProperty({
62+
| Some(ObjectExpression({properties})) =>
63+
let foundEntryPoint = properties->Array.find(property => {
64+
switch property {
65+
| ObjectProperty({
6566
key: Identifier({name: "make"}),
6667
value: Identifier({name: "Playground$App"}),
67-
}),
68-
],
69-
})) =>
70-
entryPoint.contents = true
68+
}) => true
69+
| _ => false
70+
}
71+
})
72+
entryPoint.contents = Option.isSome(foundEntryPoint)
7173
| _ => ()
7274
}
7375
| _ => ()

0 commit comments

Comments
 (0)