From 490bc58229e2efbcc2973c9f48e21a153e17cfcd Mon Sep 17 00:00:00 2001 From: Akhil Marsonya Date: Tue, 20 Apr 2021 22:25:09 +0530 Subject: [PATCH] lib: fix and improve os typings 1. marked optional params as such 2. assigned default values using jsdoc conventions. PR-URL: https://github.com/nodejs/node/pull/38316 Reviewed-By: James M Snell Reviewed-By: Shingo Inoue --- lib/os.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/os.js b/lib/os.js index a68b77ab64d304..64b25eeb4124d1 100644 --- a/lib/os.js +++ b/lib/os.js @@ -286,7 +286,7 @@ function networkInterfaces() { } /** - * @param {number} pid + * @param {number} [pid=0] * @param {number} priority * @returns {void} */ @@ -306,7 +306,7 @@ function setPriority(pid, priority) { } /** - * @param {number} pid + * @param {number} [pid=0] * @returns {number} */ function getPriority(pid) { @@ -325,9 +325,9 @@ function getPriority(pid) { } /** - * @param {{ encoding?: string }} options If `encoding` is set to `'buffer'`, - * the `username`, `shell`, and `homedir` values will be `Buffer` instances. - * Default: `'utf8'` + * @param {{ encoding?: string }} [options=utf8] If `encoding` is set to + * `'buffer'`, the `username`, `shell`, and `homedir` values will + * be `Buffer` instances. * @returns {{ * uid: number * gid: number