arktype icon indicating copy to clipboard operation
arktype copied to clipboard

Explore recreating definitions from nodes

Open ssalbdivad opened this issue 1 year ago • 4 comments

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.

ssalbdivad avatar Jul 05 '23 19:07 ssalbdivad