Not have an array, but just one object, when maxcount is 1
Open
discuss
enhancement
- Dominant language
- JavaScript
- Stars
- 12.1k
- Forks
- 1.1k
- Avg merge
- 8d 2h
- Merged PRs (30d)
- 21
Description
When using fields, for fields that have a maxCount of 1, don't have an array but a sigle file.
This makes coding much easier. For example, when having this:
````
const upload = multer().fields(
[
{ name: 'signed', maxCount: 1 },
{ name: 'generated', maxCount: 1 }
]
)
````
It would be much nicer to have `request.files.signed` to be an _object_.
Right now, you can do the same thing with `.single()`; however, you can only add one `single()` (you can't chain them).
I am asking now before you actually release 2.0, because this WOULD be a breaking change.
Contributor guide
Assessment
This issue has not been assessed yet.