log1st
Aarktype
•Created by log1st on 4/14/2025 in #questions
union of strings & Record as Generic argument
I'm using prisma and it generates Object for runtime and union of that object keys as type. Due to that I'm unable to use it in my type schemas:
I've tried to manage it using scopes but looks like it is due to conflict of types.
My current hack is:
Maybe there's more clear way?
3 replies
Aarktype
•Created by log1st on 4/6/2025 in #questions
Resolving type and its nodes
I'm making a simple arktype to openapi transformer. What's the best way to get type's definition to use in logic? I mean literally like type('string')._def.type === 'string' etc.
4 replies
Aarktype
•Created by log1st on 3/26/2025 in #questions
Issue with Default<> in Type as generic.
I'm trying to create a generic function that accepts type returns other type.
But if I'm trying to pass something that contains defaultable type it throws error:
Looks like there's a problem in my usage of Type generic. Cause if I create type without generic function it works perfectly.
15 replies
Aarktype
•Created by log1st on 2/13/2025 in #questions
ArkErrors serialization/deserialization
I'm implementing a very simple NestJS + ArkType bridge (like nestjs-zod or so). Currently I can't find a pretty way to serialize and deserialize ArkErrors object to use it in RPC transports for further use. Is there any "in-a-box" way? Looks like storing whole Traversal context and source data inside serialized object and monkey-patching methods doesn't look good.
10 replies