Skip to content

Commit

Permalink
child_process: add env contents types in JSDoc
Browse files Browse the repository at this point in the history
Use JSDoc to indicate that the `env` object keys and values must be
strings.

Refs: #42489 (comment)

PR-URL: #42494
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
Trott authored and juanarbol committed Apr 6, 2022
1 parent bff9cae commit 9a54acb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const MAX_BUFFER = 1024 * 1024;
* @param {{
* cwd?: string;
* detached?: boolean;
* env?: object;
* env?: Record<string, string>;
* execPath?: string;
* execArgv?: string[];
* gid?: number;
Expand Down Expand Up @@ -202,7 +202,7 @@ function normalizeExecArgs(command, options, callback) {
* @param {string} command
* @param {{
* cmd?: string;
* env?: object;
* env?: Record<string, string>;
* encoding?: string;
* shell?: string;
* signal?: AbortSignal;
Expand Down Expand Up @@ -256,7 +256,7 @@ ObjectDefineProperty(exec, promisify.custom, {
* @param {string[]} [args]
* @param {{
* cwd?: string;
* env?: object;
* env?: Record<string, string>;
* encoding?: string;
* timeout?: number;
* maxBuffer?: number;
Expand Down Expand Up @@ -673,7 +673,7 @@ function abortChildProcess(child, killSignal) {
* @param {string[]} [args]
* @param {{
* cwd?: string;
* env?: object;
* env?: Record<string, string>;
* argv0?: string;
* stdio?: Array | string;
* detached?: boolean;
Expand Down Expand Up @@ -746,7 +746,7 @@ function spawn(file, args, options) {
* input?: string | Buffer | TypedArray | DataView;
* argv0?: string;
* stdio?: string | Array;
* env?: object;
* env?: Record<string, string>;
* uid?: number;
* gid?: number;
* timeout?: number;
Expand Down Expand Up @@ -838,7 +838,7 @@ function checkExecSyncError(ret, args, cmd) {
* cwd?: string;
* input?: string | Buffer | TypedArray | DataView;
* stdio?: string | Array;
* env?: object;
* env?: Record<string, string>;
* uid?: number;
* gid?: number;
* timeout?: number;
Expand Down Expand Up @@ -875,7 +875,7 @@ function execFileSync(command, args, options) {
* cwd?: string;
* input?: string | Buffer | TypedArray | DataView;
* stdio?: string | Array;
* env?: object;
* env?: Record<string, string>;
* shell?: string;
* uid?: number;
* gid?: number;
Expand Down

0 comments on commit 9a54acb

Please sign in to comment.