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

fix: use closed ranges as port ranges (and some docs fixes) #66

Merged
merged 4 commits into from
Jan 4, 2024

Conversation

vvagaytsev
Copy link
Contributor

@vvagaytsev vvagaytsev commented Oct 13, 2023

πŸ”— Linked issue

None.

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

  • Added some details on the port range decriptions.
  • Fixed a couple of typos in the README.md.
  • Added some unit tests for _generateRange internal helpers.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vvagaytsev vvagaytsev changed the title docs: fix some typos docs: more clarity of pro ranges and some typo fixes Oct 13, 2023
@vvagaytsev vvagaytsev changed the title docs: more clarity of pro ranges and some typo fixes docs: more clarity of port ranges and some typo fixes Oct 13, 2023
@vvagaytsev vvagaytsev marked this pull request as draft October 13, 2023 11:45
@vvagaytsev vvagaytsev marked this pull request as ready for review October 13, 2023 11:47
@vvagaytsev
Copy link
Contributor Author

Currently, the library silently considers a range as an empty one if the range's start is greater or equal than its end.

A couple of questions/ideas:

  • Would it make sense to use closed ranges (i.e. with inclusive end)?
    If yes, then the range of [1, 1] would return a singleton array [1] instead of an empty one. That might be more intuitive and expected.

  • Should reverse ranges be supported as well?

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

πŸ’―

@pi0
Copy link
Member

pi0 commented Oct 17, 2023

Would it make sense to use closed ranges (i.e. with inclusive end)?

Sure πŸ‘πŸΌ While it is a slight behavior change, i think it would be harmless to have as a fix. Do you mind to include it in same PR as a fix? πŸ™πŸΌ

Should reverse ranges be supported as well?

It is little necessary complexity in implementation IMO. Any specific reason to do it?

@vvagaytsev
Copy link
Contributor Author

Would it make sense to use closed ranges (i.e. with inclusive end)?

Sure πŸ‘πŸΌ While it is a slight behavior change, i think it would be harmless to have as a fix. Do you mind to include it in same PR as a fix? πŸ™πŸΌ

Sure! I'll update the PR soon.

Should reverse ranges be supported as well?

It is little necessary complexity in implementation IMO. Any specific reason to do it?

No, there is no specific reason for doing that :) A reverse-ordered array can easily be created in the code and passed as a ports parameter's value if necessary.

@vvagaytsev
Copy link
Contributor Author

vvagaytsev commented Oct 18, 2023

@pi0 I made the fix in 6255565, please take a look :)

@vvagaytsev vvagaytsev changed the title docs: more clarity of port ranges and some typo fixes fix: use closed ranges as port ranges (and some docs fixes) Oct 18, 2023
@vvagaytsev
Copy link
Contributor Author

Hi @pi0! What would be the next steps to get this merged? There is one workflow awaiting approval from a maintainer. Could you help me with that, please? Thank you! :)

@pi0 pi0 merged commit 2ff49d5 into unjs:main Jan 4, 2024
@vvagaytsev vvagaytsev deleted the docs/minor-fixes-in-readme branch February 13, 2024 14:05
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.

None yet

2 participants