4 Replies
Object.entriesI wanna do it on the type level
Aha I figured it out
I converted the object to and object of it's keys to a tuple of the current key and it's type, then converted it to a tuple of it's types
(picture of my screen because I'm waiting on a new router)
It's formatted in such a way that a rust serde serialized enum will match the type

{owo: string, uwu: number} ->
{owo: ["owo", string], uwu: ["uwu", number]} ->
[["owo", string], ["uwu", number]] ->
{owo: string, uwu: undefined} | {owo: undefined, uwu: number}