From 3b84c2892cf7416f54ba323d738a78a7ea8a5b40 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Fri, 24 Jun 2022 10:53:53 +0000 Subject: [PATCH] Fix typescript errors (start raw decoding early) --- packages/squiggle-lang/src/js/index.ts | 31 ++++++-------------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index 592de8e3..7a246c41 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -129,30 +129,13 @@ function createTsExport( // case return tag( "array", - x.value.map((arrayItem): squiggleExpression => { - switch (arrayItem.tag) { - case "EvRecord": - return tag( - "record", - _.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); - } - }) + x.value.map( + (arrayItem): squiggleExpression => + convertRawToTypescript( + arrayItem as unknown as rescriptExport, + environment + ) + ) ); case "EvArrayString": return tag("arraystring", x.value);