We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
assertPort
1 parent 57c0e71 commit 33ea7a2Copy full SHA for 33ea7a2
lib/internal/net.js
@@ -1,7 +1,5 @@
1
'use strict';
2
3
-module.exports = { isLegalPort, assertPort };
4
-
5
// Check that the port number is not NaN when coerced to a number,
6
// is an integer and that it falls within the legal range of port numbers.
7
function isLegalPort(port) {
@@ -11,8 +9,6 @@ function isLegalPort(port) {
11
9
return +port === (+port >>> 0) && port <= 0xFFFF;
12
10
}
13
14
15
-function assertPort(port) {
16
- if (typeof port !== 'undefined' && !isLegalPort(port))
17
- throw new RangeError('"port" argument must be >= 0 and < 65536');
18
-}
+module.exports = {
+ isLegalPort
+};
0 commit comments