Skip to content

Commit

Permalink
lib: fix and improve os typings
Browse files Browse the repository at this point in the history
1. marked optional params as such
2. assigned default values using jsdoc conventions.

PR-URL: #38316
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
  • Loading branch information
marsonya authored and targos committed Jun 11, 2021
1 parent 5f3e96b commit 490bc58
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/os.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function networkInterfaces() {
}

/**
* @param {number} pid
* @param {number} [pid=0]
* @param {number} priority
* @returns {void}
*/
Expand All @@ -306,7 +306,7 @@ function setPriority(pid, priority) {
}

/**
* @param {number} pid
* @param {number} [pid=0]
* @returns {number}
*/
function getPriority(pid) {
Expand All @@ -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
Expand Down

0 comments on commit 490bc58

Please sign in to comment.