-
Notifications
You must be signed in to change notification settings - Fork 441
Improve Type Safety in Form Submissions Handler #7857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Improve Type Safety in Form Submissions Handler #7857
Conversation
This commit improves the type safety of the `form-submissions-handler.ts` module by: - Installing the missing `@types/multiparty` package. - Defining custom types for form fields and files. - Correcting property assignment on the `Readable` stream. - Correcting the `form.parse` callback and error handling. - Refactoring field lookups to be type-safe. - Correcting the processing of the `files` object to handle both single files and arrays of files in a type-safe manner.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
serhalp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix formatting/linting
package.json
Outdated
| "@types/lodash": "4.17.20", | ||
| "@types/lodash.shuffle": "4.2.9", | ||
| "@types/multiparty": "4.2.1", | ||
| "@types/multiparty": "^4.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this repo requires all versions be pinned. you can update this but keep it pinned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I've pinned the version for @types/multiparty.
Pins the version of `@types/multiparty` to conform to the repository's dependency versioning requirements.
This submission improves the type safety of the
form-submissions-handler.tsmodule by removing all@ts-expect-errorcomments and replacing them with robust, type-safe code. This includes installing missing type definitions, defining custom types, and refactoring the code to be more readable and maintainable.PR created automatically by Jules for task 8168542349268651262 started by @serhalp