Fix typescript errors (start raw decoding early)

This commit is contained in:
Sam Nolan 2022-06-24 10:53:53 +00:00
parent e192fe5790
commit 3b84c2892c

View File

@ -129,31 +129,14 @@ function createTsExport(
// case // case
return tag( return tag(
"array", "array",
x.value.map((arrayItem): squiggleExpression => { x.value.map(
switch (arrayItem.tag) { (arrayItem): squiggleExpression =>
case "EvRecord":
return tag(
"record",
_.mapValues(arrayItem.value, (recordValue: unknown) =>
convertRawToTypescript( convertRawToTypescript(
recordValue as rescriptExport, arrayItem as unknown as rescriptExport,
environment environment
) )
) )
); );
case "EvArray":
let y = arrayItem.value as unknown as rescriptExport[];
return tag(
"array",
y.map((childArrayItem) =>
convertRawToTypescript(childArrayItem, environment)
)
);
default:
return createTsExport(arrayItem, environment);
}
})
);
case "EvArrayString": case "EvArrayString":
return tag("arraystring", x.value); return tag("arraystring", x.value);
case "EvBool": case "EvBool":