let dict: object = {
key1: {
nestedKey: "1"
}
}
let str = "key1.nestedKey"
dict[str]
const dict = {
key1: {
nestedKey: "1"
}
}
const str = "key1.nestedKey"
const value = str.split(".").reduce((acc, key) => {
return acc[key] ? acc[key] : null;
}, dict);
console.log(value)