const newErrors: Record = {}; validationErrors.forEach((err: { field: string; message: string }) => { newErrors[err.field] = err.message; }); __ __