arktype
arktype copied to clipboard
Add `objectPath` to validation context
Request a feature
Add objectPath (along with existing root and path) to validation context
🤷 Motivation
During validation, you may want to get current parentNode, parentNode.parentNode and so on
Make an array with them for easy accedd
💡 Solution
Context may have readonly list of currently visited nodes, top to bottom, like in DFS graph algos,
with the first being root node , and the last being parent node
Was considering this a bit. Would be easy to add, but do you think in a situation like that it would be more appropriate to have the narrow on the parent node itself if that data is required as context?
Would work better for caching etc.