Help Needed: Parsing and Extracting a Single Field with Struct Schema
Hey guys. I'm trying to perform some dark magic, and I need some help. I want to parse a value using a Struct schema with just one field, and then access the value inside that field.
Example:
myparsingFunction(unparsedVal, Schema.Struct({ url: string })) // returning the url string, rather than the object { url }
myparsingFunction(unparsedVal, Schema.Struct({ url: string })) // returning the url string, rather than the object { url }
Basically, what could
myparsingFunction
myparsingFunction
be so that it can make use of the schema provided not only to parse the unparsedVal, but also drill down to extract the value in the one field after parsing?