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.
2 Replies
BozoWithTheBanjo
You probably want type.expression There are more options here https://arktype.io/docs/type-api
ArkType Docs
TypeScript's 1:1 validator, optimized from editor to runtime
No description
TizzySaurus
TizzySaurus2w ago
type.json is arguably better here since that's the actual internal ArkType schema type.expression is just a human readable version of it, but isn't as good for introspectability

Did you find this page helpful?