A utility for safely retrieving nested values.
You can install the package using npm
npm install @empathyco/x-get-safe-property-chain --save-dev
import { getSafePropertyChain } from '@empathyco/x-get-safe-property-chain';
const obj = { nestedObject: { anotherNestedObject: { message: 'Hell yeah!' } } };
const message = getSafePropertyChain(obj, 'nestedObject.anotherNestedObject.message');
console.log(message); // 'Hell yeah!'