/**
 * Removes undefined values from an object
 *
 * @param {T} obj
 * @returns {Partial<T>}
 */
export const prune = <T extends Record<string, unknown>>(
  obj: Partial<T>,
): Partial<T> => {
  return Object.fromEntries(
    Object.entries(obj).filter(([_, value]) => value !== undefined),
  ) as Partial<T>;
};
