SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Typescript Generation: Wrap union types in parens if for arrays

Open jsdt opened this issue 8 months ago • 0 comments

Description of Changes

When generating typescript types, if we have an array of unions, we wrap the inner type in parens, to fix https://github.com/clockworklabs/SpacetimeDB/issues/2541.

API and ABI breaking changes

This should only change the generated code in places that would have been a bug.

Expected complexity level and risk

Testing

I didn't see a good place to add full tests for the typescript generation. We will want to do that at some point.

For this change I created a module with some more complex array types and inspected the generated code.

jsdt avatar Apr 15 '25 17:04 jsdt