You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have a custom type that grabs all possible paths of an object with dot notation:
The 4 is passed to make sure it only goes
4levels deep. In order to keep the TS performance up.I was wondering if this already existed in
ts-toolbelt. I looked around but couldn't find it immediately!I have made 2 really useful utilities for
OPathsto get all paths, including branches and leaves, andOLeavesto just get the leaves.My implementation is this:
https://www.typescriptlang.org/play?#code/PQKhCgAIUglBTALgVwE4DsDOlEAt44CeADgQGYD2qkmiqAlugOaQA29i8qAhq5gHRQI0SAHV86HPiKlI9bN0nwAtsUSEadRi3acerSAAMA5McOQqkbpCbx0XegGMjtBs3MdIqJGixH7AG5chkLA4OqyAJKYAMpazAAyHFy8ADwAKgB8kAC8kOmQ8AAenOgAJtiu2pAA-JAAFKaFJXYV+bWQZLyYBABcOKjI8ACUkP1dfPDg4KDCMABSFIzYiADuFJAA1vCE2IyIG9ZlFIiQ6CfciPQUksSXuEJCkHEUxAqn3Kg8u-yQAPJ4LireQETzrZCsMpydCOVjIMoEQwAEgA3uhkMoAEZcAC+IWgYQiBEWjFSAGkADSQAAK2TyZOapTaVWYUA61MZrUq8SYbMgHWicTcTCSejStM55RWgym-LlHWRKLJOP4qOpeL5cv6ZM1-Q5xSZ2HRWK4mrqOvl-UCpv5VvgQVQ02AwEgxG8iCuXAAtPQmOdvOESARqd4ArlIABta2oKkABipAEYqQAmKkAZipABYqQBWKkANipAHYqQAOKkATkT8cgCaTtdTtYzteztbztcLtZLtfLtarkGTNf4w9jEYAumOnWAngBBVgGYgUTCYeiY1gEP6YgBW8Ecp2p90wVMxPBh+GwM4AcgARNjwbhBTBPAACxW4qnX-wPeEwqRRVn6f9MStDFsW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