arktype icon indicating copy to clipboard operation
arktype copied to clipboard

Add `objectPath` to validation context

Open Dimava opened this issue 2 years ago • 1 comments

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

Dimava avatar Aug 18 '23 21:08 Dimava

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.

ssalbdivad avatar May 14 '24 17:05 ssalbdivad