import { set } from 'lodash';

export const extractFormData = ({ currentTarget }: any) => {
  const data: any = {};

  for (const input of currentTarget.elements) {
    if (input.name) set(data, input.name, input.value);
  }

  return data;
};
