Open lorisleiva opened 3 months ago
When a EnumTupleVariantTypeNode contains a single item in the enum, we should transform the data enum helper such that it requires that item's value directly instead of having to wrap it in an array.
EnumTupleVariantTypeNode
For instance, consider the following enum:
definedTypeNode({ name: 'message', type: enumTypeNode([ enumTupleVariantTypeNode( 'write', tupleTypeNode([numberTypeNode('u16')]) ) ]), })
Then instead of generating the following helper:
const myMessage = message('write', [42]);
We could simplify it to:
const myMessage = message('write', 42);
When a
EnumTupleVariantTypeNode
contains a single item in the enum, we should transform the data enum helper such that it requires that item's value directly instead of having to wrap it in an array.For instance, consider the following enum:
Then instead of generating the following helper:
We could simplify it to: