Derive Type from Parameter of function attach to object (possibly recursive idk)
Hey Guys, so to explain what I'm doing, I'm basically defining a data structure to plug into a function of mine.
The data structure is a key value and a class object that is defined on the fly. Like this
The
Validation.new()
function is used to define the default value for each field and instantiate an object to build my validation strategy.
This is the ValidationShape type and here is the Validation object class
So this is the object attached to each invidual key fpr my ValidationShape
object. Now, I would like to take this shape, iterate over it and get the default value and its type and then take those values to create a new shape that is the key: ReturnType<GetDefaultValue>
Notice the reshape version is now just strings, since each new
call was called with an empty string.1 Reply
Sorry, what's the issue here?