export const getValueFromNestedObject = (
  fieldName: string,
  object: any
): any => {
  if (!fieldName || typeof fieldName !== "string") return undefined;

  return fieldName
    .split(".")
    .reduce(
      (acc, key) => (acc !== undefined && acc !== null ? acc[key] : undefined),
      object
    );
};
