Given a path divided by dots (example: 'foo.bar') you can find an object inside another parent object
npm install @imjano/get_object_in_object
const path = 'foo.bar'
const obj = { foo: { bar: 'hello' } }
console.log(getObjectInObject(obj, path)) //output: 'hello'