Hi all I'm wondering if somebody could help me.
I have a function that takes each level of an object as a string with a dot seperator
eg
const fooType = {
test: {
test1: {
test2: 'test'
}
},
testing: {
testable: 'be'
},
bottom: 'b'
};
so if I wanted to get the value of test2 I would write the function as
foo('test.test1.test2')
if I take the following type fooTypeProps = keyof typeof fooType;
It gives me a union of test | testing | bottom
I'm wondering if there is a way in typescript to get that keyof but for all the layors so In this situation I would have a union of test.test1.test2 | testing.testable | bottom