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 <jasnell@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
This commit is contained in:
Akhil Marsonya 2021-04-20 22:25:09 +05:30 committed by Michaël Zasso
parent 5f3e96b570
commit 490bc58229
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600

View File

@ -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