-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Update index.d.ts #154
Update index.d.ts #154
Conversation
If the field names are the same, the value of the field will be an array.
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.
lgtm, thanks.
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.
Would you mind to add a test for this type?
@mcollina |
|
Considering the properties of the field type, it seems necessary to split Multipart into two interfaces. type Multipart = MultipartField | MultipartFile
interface MultipartField {
fieldname: string
value: string
fieldnameTruncated: boolean
valueTruncated: boolean
fields: MultipartFields
}
interface MultipartFile {
toBuffer: () => Promise<Buffer>,
file: NodeJS.ReadableStream,
filepath: string,
fieldname: string,
filename: string,
encoding: string,
mimetype: string,
fields: MultipartFields
} |
I might also export all interfaces (for example Multipart) so one can use them for own function declarations that use the result |
I don't understand the question. Is this ready to land? |
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.
lgtm
Could be different pr, but for example I might wan't to define separate handler which would take just the Multipart as an argument. Currently not possible without defining it again.
With type exports one could just do |
This PR is ready to merge. It may take someone more familiar with this project to decide which TypeScript interfaces should be exported, not me. |
Nice work! Thanks for you contribution. |
Co-authored-by: Maksim Sinik <maksim@sinik.it>
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.
LGTM
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.
lgtm
Update
index.d.ts
to v3.0Checklist
npm run test
andnpm run benchmark
and the Code of conduct