fix(legacy-json): fix parameter ordering#325
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the argument order of the updateDepth helper so that optional parameters are tracked correctly.
- Swaps the parameter order in
updateDepthfrom(char, depth)to(depth, char) - Adjusts the function definition to match its usage
Comments suppressed due to low confidence (1)
src/generators/legacy-json/utils/parseSignature.mjs:9
- The JSDoc @param annotations weren’t updated after swapping the parameters. Update the first tag to
@param {Number} depthand the second to@param {String} charto match the new signature.
* @param {String} char
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #325 +/- ##
=======================================
Coverage ? 71.51%
=======================================
Files ? 117
Lines ? 9721
Branches ? 590
=======================================
Hits ? 6952
Misses ? 2766
Partials ? 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
|
It's being called like: optionalDepth = [...parameterName.slice(endingIdx + 1)].reduce(
updateDepth,
optionalDepth
);
|
flakey5
approved these changes
Jun 27, 2025
Member
Author
|
(Also, |
AugustinMauroy
approved these changes
Jun 28, 2025
Member
|
Fast-tracking :) |
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.

This function was being called backwards, resulting in no parameters being marked optional.