@@ -381,7 +381,7 @@ function Socket(options) { |
381 | 381 | 'is not supported', |
382 | 382 | ); |
383 | 383 | } |
384 | | - if (typeof options?.keepAliveInitialDelay !== 'undefined') { |
| 384 | + if (options?.keepAliveInitialDelay !== undefined) { |
385 | 385 | validateNumber( |
386 | 386 | options?.keepAliveInitialDelay, 'options.keepAliveInitialDelay', |
387 | 387 | ); |
@@ -1319,7 +1319,7 @@ function lookupAndConnect(self, options) { |
1319 | 1319 | validateNumber(localPort, 'options.localPort'); |
1320 | 1320 | } |
1321 | 1321 |
|
1322 | | - if (typeof port !== 'undefined') { |
| 1322 | + if (port !== undefined) { |
1323 | 1323 | if (typeof port !== 'number' && typeof port !== 'string') { |
1324 | 1324 | throw new ERR_INVALID_ARG_TYPE('options.port', |
1325 | 1325 | ['number', 'string'], port); |
@@ -1776,7 +1776,7 @@ function Server(options, connectionListener) { |
1776 | 1776 | } else { |
1777 | 1777 | throw new ERR_INVALID_ARG_TYPE('options', 'Object', options); |
1778 | 1778 | } |
1779 | | - if (typeof options.keepAliveInitialDelay !== 'undefined') { |
| 1779 | + if (options.keepAliveInitialDelay !== undefined) { |
1780 | 1780 | validateNumber( |
1781 | 1781 | options.keepAliveInitialDelay, 'options.keepAliveInitialDelay', |
1782 | 1782 | ); |
@@ -1785,7 +1785,7 @@ function Server(options, connectionListener) { |
1785 | 1785 | options.keepAliveInitialDelay = 0; |
1786 | 1786 | } |
1787 | 1787 | } |
1788 | | - if (typeof options.highWaterMark !== 'undefined') { |
| 1788 | + if (options.highWaterMark !== undefined) { |
1789 | 1789 | validateNumber( |
1790 | 1790 | options.highWaterMark, 'options.highWaterMark', |
1791 | 1791 | ); |
@@ -2076,7 +2076,7 @@ Server.prototype.listen = function(...args) { |
2076 | 2076 | // or (options[, cb]) where options.port is explicitly set as undefined or |
2077 | 2077 | // null, bind to an arbitrary unused port |
2078 | 2078 | if (args.length === 0 || typeof args[0] === 'function' || |
2079 | | - (typeof options.port === 'undefined' && 'port' in options) || |
| 2079 | + (options.port === undefined && 'port' in options) || |
2080 | 2080 | options.port === null) { |
2081 | 2081 | options.port = 0; |
2082 | 2082 | } |
|