From 2c105634d51a97d80776553e240457d6bce17c97 Mon Sep 17 00:00:00 2001 From: nerdthatnoonelikes Date: Sun, 6 Jun 2021 12:29:37 -0500 Subject: [PATCH 1/2] typings: Add a few JSDoc typings for the net lib module --- lib/net.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/net.js b/lib/net.js index 4b55366f87dae0..abb27d246841cc 100644 --- a/lib/net.js +++ b/lib/net.js @@ -162,6 +162,16 @@ function isPipeName(s) { return typeof s === 'string' && toNumber(s) === false; } +/** + * Creates a new TCP or IPC server + * @param {{ + * allowHalfOpen?: boolean; + * pauseOnConnect?: boolean; + * }} options + * @param {Function} connectionListener + * @returns {Server} + */ + function createServer(options, connectionListener) { return new Server(options, connectionListener); } @@ -1549,6 +1559,11 @@ function onconnection(err, clientHandle) { self.emit('connection', socket); } +/** + * Gets the number of concurrent connections on the server + * @param {Function} cb + * @returns {Server} + */ Server.prototype.getConnections = function(cb) { const self = this; From 70cc7ec42f3bce4106248b0fdbfe6d85e459f4d2 Mon Sep 17 00:00:00 2001 From: nerdthatnoonelikes Date: Sun, 6 Jun 2021 12:47:24 -0500 Subject: [PATCH 2/2] typings: Fix JSDoc typings for net lib module --- lib/net.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/net.js b/lib/net.js index abb27d246841cc..f131f557a656a6 100644 --- a/lib/net.js +++ b/lib/net.js @@ -165,10 +165,10 @@ function isPipeName(s) { /** * Creates a new TCP or IPC server * @param {{ - * allowHalfOpen?: boolean; - * pauseOnConnect?: boolean; - * }} options - * @param {Function} connectionListener + * allowHalfOpen?: boolean; + * pauseOnConnect?: boolean; + * }} [options] + * @param {Function} [connectionListener] * @returns {Server} */