We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
get-port/index.js
Lines 163 to 165 in 50e24f6
Is this + 1 logic correct?
+ 1
If you run this snippet:
import { portNumbers } from 'get-port'; console.log([...portNumbers(65535, 65536)]);
You get the output
[ 65535, 65536 ]
The maximum port number should be 65,535 but the argument validation seems to allow the value 65536 to be returned.
65536
If this is a bug I'd be happy to PR it.
The text was updated successfully, but these errors were encountered:
@mastrzyz
Sorry, something went wrong.
Interesting, this does look like a bug but , I'd like some more context @sindresorhus , previously the code was :
if (to < 1024 || to > 65_536) { throw new RangeError('`to` must be between 1024 and 65536'); }
My change d03c07b , changed it to :
const maxPort = 65_535; if (to < minPort || to > maxPort + 1) { throw new RangeError(`'to' must be between ${minPort} and ${maxPort + 1}`); }
So its effectively the same code as before, was it always a bug here?
portNumbers
was it always a bug here?
Seems so.
Successfully merging a pull request may close this issue.
get-port/index.js
Lines 163 to 165 in 50e24f6
Is this
+ 1
logic correct?If you run this snippet:
You get the output
The maximum port number should be 65,535 but the argument validation seems to allow the value
65536
to be returned.If this is a bug I'd be happy to PR it.
The text was updated successfully, but these errors were encountered: