Skip to content

Conversation

Phillip9587
Copy link
Contributor

Based on #550

This PR introduces the normalizeOptions function, which standardizes and validates common parser options like inflate, limit, type, and verify. It ensures consistent defaults and removes duplication across the parsers.

@wesleytodd
Copy link
Member

How much of this would also overlap with @ctcpip's attempt to revive #544? Would we be better off talking that approach to simplification?

Copy link
Member

@jonchurch jonchurch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it LGTM, but with the one nit I left so marking as request for change. The nit doesn't have to block, but I think it's a sane addition.

@Phillip9587
Copy link
Contributor Author

@jonchurch I've made the requested changes. I think we should merge this first as foundational work for #22, so that when we start on it, the necessary changes are already in place and the scope remains smaller. Let me know what you think!

@Phillip9587 Phillip9587 force-pushed the normalize-options branch 3 times, most recently from ee6ba4c to b760930 Compare February 18, 2025 08:01
Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lib/utils.js Outdated
Comment on lines 1 to 7
/*!
* body-parser
* Copyright(c) Express Contributors
* MIT Licensed
*/

'use strict'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*!
* body-parser
* Copyright(c) Express Contributors
* MIT Licensed
*/
'use strict'
'use strict'

files should not get copyright headers

@Phillip9587
Copy link
Contributor Author

Hey everyone, I just wanted to follow up on this PR and see if there's anything I can do to help move it forward. Let me know if any changes or additional context are needed! Thanks!

@Phillip9587
Copy link
Contributor Author

Hey @jonchurch, thanks again for your review and approval a few weeks ago! I just wanted to check in and see if it’s all right to go ahead and merge this. Let me know if you have any additional concerns.

@UlisesGascon
Copy link
Member

Is this a semver minor, right?

@bjohansebas
Copy link
Member

I would say it's a patch, this change doesn't introduce any new functionality, it just refactors it.

@Phillip9587
Copy link
Contributor Author

@UlisesGascon Can we merge this now?

@UlisesGascon
Copy link
Member

I am checking with @wesleytodd... So far the plan is to include it in the next release (that will be shipped to in Express 5.1.0) :)

@Phillip9587
Copy link
Contributor Author

@UlisesGascon Thanks! My work on #22 depends on this, so I'd really appreciate it if it could be merged soon.

@UlisesGascon UlisesGascon merged commit d11899b into expressjs:master Mar 26, 2025
12 checks passed
@Phillip9587 Phillip9587 deleted the normalize-options branch March 26, 2025 21:50
@UlisesGascon UlisesGascon mentioned this pull request Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants