getValueFromObject = (object, name) => {
  // check if the name is present ('as such') in the object.
  if (object && object[name]) {
    return object[name];
  } else if (object && (name.includes('[') && name.includes(']'))) {
    // name is consider as a key followed by array indices.
    const names = name
      .split(']')
      .join('')
      .split('[');
    let tempObj = object;
    for (let i = 0; i < names.length; i++) {
      const selector = names[i];
      if (!tempObj) {
        break;
      } else {
        tempObj = tempObj[selector];
      }
    }
    return tempObj;
  }
  return null;
}
Return a value if the key is present else null.
@param  {Object} object the object which needs to parsed.
@param  {String} name   the string which is needed.
@return {Object}        the value of the given key.