arktype
arktype copied to clipboard
Explore recreating definitions from nodes
Using the new metadata attached to type nodes, we could convert a type node back into a minimal definition for that node in a given scope.
This could be extremely useful for both generating ArkType definitions from other formats as well as testing.
Using a library like fast-check, we could generate thousands of random valid definitions in the minimal format and ensure that each is parsed successfully as a type node that can then be converted back to its original input.