Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
derive-typescript: fix codegen for empty enums
We saw a derivation that failed validation because the generated Typescript code was syntactically invalid. This was caused by the inferred `Shape` having an empty set of enum variants (`enum_: Some([])`). The empty enum variants cause the generated code to omit any sort of type, which causes Deno to fail to parse it. I'm not completely certain whether the fault is with the Typescript code generation or the Shape inferrence, but it's pretty easy to filter out empty enums in the code generation, which results in generated code correctly having the `never` type. I also added a debug log of the generated types file, so that this type of thing is easier to debug in the future.
- Loading branch information