Clean up optsParser function and add jsdoc for parsed options object#944
Merged
KernelDeimos merged 1 commit intohttp-party:masterfrom Jan 22, 2026
Merged
Clean up optsParser function and add jsdoc for parsed options object#944KernelDeimos merged 1 commit intohttp-party:masterfrom
KernelDeimos merged 1 commit intohttp-party:masterfrom
Conversation
Contributor
|
looks good to me. The diff shows |
Contributor
|
Tests pass - I'll merge when the diff is clean (rebased onto main) |
Contributor
Author
|
should be clean now |
Contributor
|
Great, much easier to verify without the noise. That said, even though I reviewed this carefully don't rely on my review 100% - keep a mental background process running for a day or two to try find any potential regressions with this change because it could significantly impact any automation with shell scripts etc using the commandline. We need to be really careful about this (I might sound repetitive but it can't be emphasized enough) because this package is relatively early in the node ecosystem. |
This file contains hidden or 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
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.
Shuffles some things around in opts.js - first step towards trying to address #928
First adds a jsdoc typedef to the parsed options struct, which should help maintainability a bit.
To make it more ergonomic, we should move more of the input validation into this function as well. I already moved the
defaultExtvalidation/normalization there, and will probably move more things there or add additional validation laterdefaults.json has also been removed, I'm not sure it makes much sense to keep it as a json file since some of the options can be non trivial datatypes like functions, and we'll probably end up having a separate set of cli option defaults that can be somewhere else
Tests are all passing and this doesn't seem like too much of a risky change but could use some review.
Let me know if you have any feedback