import type { SupplierCreateForm } from '../types';
import { EMPTY_CREATE_FORM } from '../types';

export function cloneCreateForm(form: SupplierCreateForm): SupplierCreateForm {
  return {
    ...form,
    otherDocFiles: [...form.otherDocFiles],
  };
}

export function isCreateFormDirty(
  form: SupplierCreateForm,
  baseline: SupplierCreateForm = EMPTY_CREATE_FORM,
): boolean {
  return JSON.stringify(form) !== JSON.stringify(baseline);
}
