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

issue solve #17756 #18317

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

issue solve #17756 #18317

wants to merge 3 commits into from

Conversation

rohannsahh
Copy link

@rohannsahh rohannsahh commented Apr 11, 2024

issue #17756
update case for " ~ " when remainder.length<2

satisfy(parseRange('~1'), '1.2.3') === true

unittest update for ~1 ,~2

update test cases for ~1 ,~2
Update parseSimple logic for ~
@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@rohannsahh rohannsahh changed the title issue solve 17756 issue solve #17756 Apr 12, 2024
@alexander-akait
Copy link
Member

Can you look at failed test?

@webpack-bot
Copy link
Contributor

Hi @rohannsahh.

Just a little hint from a friendly bot about the best practice when submitting pull requests:

Don't submit pull request from your own main branch. It's recommended to create a feature branch for the PR.

You don't have to change it for this PR, just make sure to follow this hint the next time you submit a PR.

@rohannsahh
Copy link
Author

rohannsahh commented Apr 13, 2024

Screenshot 2024-04-13 124253
Hey @alexander-akait , i tried a lot to solve #17756 . I think the problem is in parseSimple in parseRange function.
for case ( ~ ) it doesn't consider the single number like (1 , 1.2.3)
current logic :
case "
":
return [2, ...remainder.slice(1)];
what i tried :
case "~":
if (remainder.length < 2) {
return [1, ...remainder.slice(1)];
}
return [2, ...remainder.slice(1)];
here i put a condition for remainder.length ==1 , but it didn't work.

for case : ^ , it works for single number like (^1 , 1.2.3)
case "^":
if (remainder.length > 1 && remainder[1] === 0) {
if (remainder.length > 2 && remainder[2] === 0) {
return [3, ...remainder.slice(1)];
}
return [2, ...remainder.slice(1)];
}
return [1, ...remainder.slice(1)];

I am new to webpack community and open-source contributions . I can do it , if someone from community can guide me.
sorry , if any inconvinience caused due to me .
Thankyou
Rohan

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.

None yet

3 participants