From 9a54acb7c6c41300e9c8188b574b6fbf8853e403 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 30 Mar 2022 07:03:48 -0700 Subject: [PATCH] child_process: add env contents types in JSDoc Use JSDoc to indicate that the `env` object keys and values must be strings. Refs: https://github.com/nodejs/node/pull/42489#discussion_r835867932 PR-URL: https://github.com/nodejs/node/pull/42494 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel --- lib/child_process.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/child_process.js b/lib/child_process.js index 5679d4e6c90865..438ebaf9ebf978 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -96,7 +96,7 @@ const MAX_BUFFER = 1024 * 1024; * @param {{ * cwd?: string; * detached?: boolean; - * env?: object; + * env?: Record; * execPath?: string; * execArgv?: string[]; * gid?: number; @@ -202,7 +202,7 @@ function normalizeExecArgs(command, options, callback) { * @param {string} command * @param {{ * cmd?: string; - * env?: object; + * env?: Record; * encoding?: string; * shell?: string; * signal?: AbortSignal; @@ -256,7 +256,7 @@ ObjectDefineProperty(exec, promisify.custom, { * @param {string[]} [args] * @param {{ * cwd?: string; - * env?: object; + * env?: Record; * encoding?: string; * timeout?: number; * maxBuffer?: number; @@ -673,7 +673,7 @@ function abortChildProcess(child, killSignal) { * @param {string[]} [args] * @param {{ * cwd?: string; - * env?: object; + * env?: Record; * argv0?: string; * stdio?: Array | string; * detached?: boolean; @@ -746,7 +746,7 @@ function spawn(file, args, options) { * input?: string | Buffer | TypedArray | DataView; * argv0?: string; * stdio?: string | Array; - * env?: object; + * env?: Record; * uid?: number; * gid?: number; * timeout?: number; @@ -838,7 +838,7 @@ function checkExecSyncError(ret, args, cmd) { * cwd?: string; * input?: string | Buffer | TypedArray | DataView; * stdio?: string | Array; - * env?: object; + * env?: Record; * uid?: number; * gid?: number; * timeout?: number; @@ -875,7 +875,7 @@ function execFileSync(command, args, options) { * cwd?: string; * input?: string | Buffer | TypedArray | DataView; * stdio?: string | Array; - * env?: object; + * env?: Record; * shell?: string; * uid?: number; * gid?: number;