Open PeytonHanel opened 1 month ago
Interesting, let me try this one soon! it seems it could've work
Thank you, I would really appreciate this feature!
Another consideration could be creating a new property on schema next to keys, could be called options
or literals
or something. It could be the place where all literal values and other values could go and could look like this:
schema.keys.size // => 'size'
schema.options.size.S // => 'S'
and possibly even a way to get all of them
schema.options.size.all // => ['S', 'M', 'L']
Or the object could just be converted to an array
Any updates to this? This would really help my project out.
Would it be possible to access string literals somehow? I want to define a property in my validation object which only accept an OR union of string literals.
I'm hoping to have something like this:
But I'm not sure if this possible with how Typescript works.