-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
Url search params and remove multiple #730
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open
I will review it soon. |
An utility to force get singular values const firstValuesOfFields = fields => {
return Object.fromEntries(Object.entries(fields).map(([key, value]) => {
return [key, value[0]];
}));
};
// ...
form.parse(request, async (err, fieldsM /*files*/) => {
const fields = firstValuesOfFields(fieldsM); |
GrosSacASac
added a commit
that referenced
this pull request
Oct 30, 2021
* chore: start version 3 * feat: Use ES modules (#727) * feat: Url search params and remove multiple (#730) * docs: Fixed the missing "=" in options.filter (#732) * docs: fix example * docs: specify what part actually is * docs: fix types * docs: add warning for progress event * docs: finish removing multiples in examples * docs: add example for express as middleware * docs: example handle common internet errors * feat: add corepack support * fix: corepack support * fix: fix examples comment * fix: fix example comment * feat: add firstValues, readBooleans helpers (#757) * feat: add firstValues, readBooleans helpers * feat: export types * docs: document helpers * docs: fix example * fix: #760 (#761) * fix: fix error when there is an error * tests: fix some of the tests (#763) * chore: up supertest jest and nyc * tests: convert to import , fix some tests * test: make malformed boundary as per comment ? * tests: refactor * style: fix some prettier issues (#764) * chore: publish as 3.x tag * docs: add changelog link * docs: typo Co-authored-by: Hrushikesh Das <[email protected]> Co-authored-by: Jimmy Wärting <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
remove multiples
remove unused qs and querystring dependency
files and fields are always arrays to avoid type errors
use modern URLSearchParams https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams internally