Hey guys, i'm looking for a suite of TS supporting object traversal functions. An example, given a JSON tree of unknown depth and a discriminated union of shapes. Given a key value pair:
- Remove the parent object that key value pair are properties of
- Update the object where that key value pair is present with a new object (additional param on function)
I've TS definition for the tree shape, and I'd like to have this inferred through.
For a clearer example - I'm looking to satisfy the following tests : https://tsplay.dev/mZ10oN
Any tips on libraries, or approaches, i'm coming up blank - many thanks!
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.