Content pfp
Content
@
0 reply
0 recast
0 reaction

Nicholas Charriere pfp
Nicholas Charriere
@pushix
I was looking at google's new node SDK for gemini. I like this "disjoint types" pattern. A very good way to make your TypeScript very readable + meaningful, I have used something similar, but not with the "never" trick.
7 replies
0 recast
10 reactions

Cassie Heart pfp
Cassie Heart
@cassie
Discriminated Unions are a good feature, if only typescript had a better way to actually identify the type (I know it’s javascript’s fault it can’t, but I still wish it did)
2 replies
0 recast
4 reactions

Benjamin Lim pfp
Benjamin Lim
@benlim
Couldn't you use a custom type property to identify the type? (i.e. InlineDataPart { type: "inline" }, TextPart { type: "text" })
0 reply
0 recast
1 reaction