arktype
arktype copied to clipboard
Unify AST processing between functional expressions, tuple expression, strings, standardize runtime semantic validation
After the refactor is complete, search repo for this issue's link and address any TODOs referencing it.
Also, add:
= (Default value) (should also work in string) Merge (maybe use "+", should not only be tuple expression)
Should also allow flat tuple expressions like:
const t = type(["string", "|", "boolean", "|", "number"])
Also consider reintegrating static satisifiability validation, e.g. for type("string&number")
. This could be useful at least to do shallowly to help with cases like morphs.
It was a pain maintaining it across strings and tuple expressions, but may be more viable once this is implemented.