Fixed typescript build
This commit is contained in:
parent
1c4557b638
commit
078534f7c8
|
@ -120,6 +120,10 @@ function createTsExport(
|
|||
x: expressionValue,
|
||||
environment: environment
|
||||
): squiggleExpression {
|
||||
switch (x) {
|
||||
case "EvVoid":
|
||||
return tag("void", "");
|
||||
default: {
|
||||
switch (x.tag) {
|
||||
case "EvArray":
|
||||
// genType doesn't convert anything more than 2 layers down into {tag: x, value: x}
|
||||
|
@ -153,7 +157,8 @@ function createTsExport(
|
|||
return tag("number", x.value);
|
||||
case "EvRecord":
|
||||
// genType doesn't support records, so we have to do the raw conversion ourself
|
||||
let result: tagged<"record", { [key: string]: squiggleExpression }> = tag(
|
||||
let result: tagged<"record", { [key: string]: squiggleExpression }> =
|
||||
tag(
|
||||
"record",
|
||||
_.mapValues(x.value, (x: unknown) =>
|
||||
convertRawToTypescript(x as rescriptExport, environment)
|
||||
|
@ -173,8 +178,10 @@ function createTsExport(
|
|||
case "EvTypeIdentifier":
|
||||
return tag("typeIdentifier", x.value);
|
||||
case "EvType":
|
||||
let typeResult: tagged<"type", { [key: string]: squiggleExpression }> =
|
||||
tag(
|
||||
let typeResult: tagged<
|
||||
"type",
|
||||
{ [key: string]: squiggleExpression }
|
||||
> = tag(
|
||||
"type",
|
||||
_.mapValues(x.value, (x: unknown) =>
|
||||
convertRawToTypescript(x as rescriptExport, environment)
|
||||
|
@ -194,3 +201,5 @@ function createTsExport(
|
|||
return moduleResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,7 +131,8 @@ export type squiggleExpression =
|
|||
| tagged<"record", { [key: string]: squiggleExpression }>
|
||||
| tagged<"type", { [key: string]: squiggleExpression }>
|
||||
| tagged<"typeIdentifier", string>
|
||||
| tagged<"module", { [key: string]: squiggleExpression }>;
|
||||
| tagged<"module", { [key: string]: squiggleExpression }>
|
||||
| tagged<"void", string>;
|
||||
|
||||
export { lambdaValue };
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user