Skip to content

Commit a925f31

Browse files
Trottxtx1130
authored andcommitted
child_process: add env contents types in JSDoc
Use JSDoc to indicate that the `env` object keys and values must be strings. Refs: nodejs#42489 (comment) PR-URL: nodejs#42494 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 68b8b01 commit a925f31

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/child_process.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const MAX_BUFFER = 1024 * 1024;
9898
* @param {{
9999
* cwd?: string;
100100
* detached?: boolean;
101-
* env?: object;
101+
* env?: Record<string, string>;
102102
* execPath?: string;
103103
* execArgv?: string[];
104104
* gid?: number;
@@ -199,7 +199,7 @@ function normalizeExecArgs(command, options, callback) {
199199
* @param {string} command
200200
* @param {{
201201
* cmd?: string;
202-
* env?: object;
202+
* env?: Record<string, string>;
203203
* encoding?: string;
204204
* shell?: string;
205205
* signal?: AbortSignal;
@@ -253,7 +253,7 @@ ObjectDefineProperty(exec, promisify.custom, {
253253
* @param {string[]} [args]
254254
* @param {{
255255
* cwd?: string;
256-
* env?: object;
256+
* env?: Record<string, string>;
257257
* encoding?: string;
258258
* timeout?: number;
259259
* maxBuffer?: number;
@@ -662,7 +662,7 @@ function abortChildProcess(child, killSignal) {
662662
* @param {string[]} [args]
663663
* @param {{
664664
* cwd?: string;
665-
* env?: object;
665+
* env?: Record<string, string>;
666666
* argv0?: string;
667667
* stdio?: Array | string;
668668
* detached?: boolean;
@@ -735,7 +735,7 @@ function spawn(file, args, options) {
735735
* input?: string | Buffer | TypedArray | DataView;
736736
* argv0?: string;
737737
* stdio?: string | Array;
738-
* env?: object;
738+
* env?: Record<string, string>;
739739
* uid?: number;
740740
* gid?: number;
741741
* timeout?: number;
@@ -827,7 +827,7 @@ function checkExecSyncError(ret, args, cmd) {
827827
* cwd?: string;
828828
* input?: string | Buffer | TypedArray | DataView;
829829
* stdio?: string | Array;
830-
* env?: object;
830+
* env?: Record<string, string>;
831831
* uid?: number;
832832
* gid?: number;
833833
* timeout?: number;
@@ -864,7 +864,7 @@ function execFileSync(command, args, options) {
864864
* cwd?: string;
865865
* input?: string | Buffer | TypedArray | DataView;
866866
* stdio?: string | Array;
867-
* env?: object;
867+
* env?: Record<string, string>;
868868
* shell?: string;
869869
* uid?: number;
870870
* gid?: number;

0 commit comments

Comments
 (0)