JameEnder
JameEnder
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
No worries, i value the work you're doing and it's the least i can do
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
(this is probably the best place I figured to ask lol)
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
Hi, I'd like to ask if you plan on supporting recursive types -> JSON, as it would be a huge improvement for me and my team :)
123 replies
Aarktype
Created by JameEnder on 9/22/2024 in #questions
Automatic "full" discriminated union
I'll test it out later today and let you know
23 replies
Aarktype
Created by JameEnder on 9/22/2024 in #questions
Automatic "full" discriminated union
Neat
23 replies
Aarktype
Created by JameEnder on 9/22/2024 in #questions
Automatic "full" discriminated union
It seems weird that the library can't do it on its own
23 replies
Aarktype
Created by JameEnder on 9/22/2024 in #questions
Automatic "full" discriminated union
That seems like a working solution, yet i wanted to reduce the complexity, not the other way around :D
23 replies
Aarktype
Created by JameEnder on 9/22/2024 in #questions
Automatic "full" discriminated union
That's useful, just not for solving this specific issue :D
23 replies
Aarktype
Created by JameEnder on 9/22/2024 in #questions
Automatic "full" discriminated union
Tried both to add the + field to each definition, or apply the onUnknownKey to the final Input, and both dont fix the issue
23 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
maybeParseSchema sounds silly, but gets the message across the best imo
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
But on that note I don't know what the best naming practices in JS space are, so thats more of a feeling than anything
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
I'm not sure about the "try" part, as that atleast to me implies that I should use a try catch block if the parsing fails, which isn't the case, because it returns the error as value without throwing
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
That looks great
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
Right, also I love the return error as value with type, I miss it a lot when I switch from Rust to TS
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
But at that moment, I'd assume you would just do JSON.parse and use type, idk
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
But that could be misleading, as you could just parse a json of {"field": "number"} and it would not work as you could expect
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
That's fine by me, maybe exporting the schema fn as something more verbose would be good for newcomers? Something like typeFromJson or similar
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
And it would have to stay that way, as functions just cant be serialized because of potential external dependencies inside the fn body
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
Yeah that makes sense
123 replies
Aarktype
Created by JameEnder on 4/12/2024 in #questions
Export type to JSON and share it
Got you
123 replies