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,30 +129,13 @@ 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": convertRawToTypescript(
return tag( arrayItem as unknown as rescriptExport,
"record", environment
_.mapValues(arrayItem.value, (recordValue: unknown) => )
convertRawToTypescript( )
recordValue as rescriptExport,
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);