Replies: 1 comment
-
My (new) question is really similiar to yours @mesqueeb question: #296 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
4
levels 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
OPaths
to get all paths, including branches and leaves, andOLeaves
to just get the leaves.My implementation is this:
https://www.typescriptlang.org/play?#code/PQKhCgAIUglBTALgVwE4DsDOlEAt44CeADgQGYD2qkmiqAlugOaQA29i8qAhq5gHRQI0SAHV86HPiKlI9bN0nwAtsUSEadRi3acerSAAMA5McOQqkbpCbx0XegGMjtBs3MdIqJGixH7AG5chkLA4OqyAJKYAMpazAAyHFy8ADwAKgB8kAC8kOmQ8AAenOgAJtiu2pAA-JAAFKaFJXYV+bWQZLyYBABcOKjI8ACUkP1dfPDg4KDCMABSFIzYiADuFJAA1vCE2IyIG9ZlFIiQ6CfciPQUksSXuEJCkHEUxAqn3Kg8u-yQAPJ4LireQETzrZCsMpydCOVjIMoEQwAEgA3uhkMoAEZcAC+IWgYQiBEWjFSAGkADSQAAK2TyZOapTaVWYUA61MZrUq8SYbMgHWicTcTCSejStM55RWgym-LlHWRKLJOP4qOpeL5cv6ZM1-Q5xSZ2HRWK4mrqOvl-UCpv5VvgQVQ02AwEgxG8iCuXAAtPQmOdvOESARqd4ArlIABta2oKkABipAEYqQAmKkAZipABYqQBWKkANipAHYqQAOKkATkT8cgCaTtdTtYzteztbztcLtZLtfLtarkGTNf4w9jEYAumOnWAngBBVgGYgUTCYeiY1gEP6YgBW8Ecp2p90wVMxPBh+GwM4AcgARNjwbhBTBPAACxW4qnX-wPeEwqRRVn6f9MStDFsWoHFIBxTInmdLwfAwbBjG4YxIAAH0gJD+ExYxQnAYpF1QU4iS-Q8MipW8DS5M5QK4cME1jOlI2vMdJTaKN7S4Sd+TqaM2X6ApKKl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