Skip to content
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

refactor: normalize common options for all parsers #551

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants