unjs / get-port-please

๐Ÿ”Œ Get an available open port
MIT License
245 stars 12 forks source link

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

Closed vvagaytsev closed 8 months ago

vvagaytsev commented 11 months ago

๐Ÿ”— Linked issue

None.

โ“ Type of change

๐Ÿ“š Description

๐Ÿ“ Checklist

vvagaytsev commented 11 months ago

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:

pi0 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

vvagaytsev commented 11 months ago

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! :)