Skip to content

Commit e916a2a

Browse files
dnluptargos
authored andcommitted
lib: remove usage of require('util')
Remove usage of public require('util') in `internal/child_process`. Refs: #26546 PR-URL: #26773 Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent cc76f3f commit e916a2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/internal/child_process.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const EventEmitter = require('events');
1919
const net = require('net');
2020
const dgram = require('dgram');
2121
const util = require('util');
22+
const inspect = require('internal/util/inspect').inspect;
2223
const assert = require('internal/assert');
2324

2425
const { Process } = internalBinding('process_wrap');
@@ -887,7 +888,7 @@ function _validateStdio(stdio, sync) {
887888
throw new ERR_INVALID_OPT_VALUE('stdio', stdio);
888889
}
889890
} else if (!Array.isArray(stdio)) {
890-
throw new ERR_INVALID_OPT_VALUE('stdio', util.inspect(stdio));
891+
throw new ERR_INVALID_OPT_VALUE('stdio', inspect(stdio));
891892
}
892893

893894
// At least 3 stdio will be created
@@ -967,12 +968,12 @@ function _validateStdio(stdio, sync) {
967968
} else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
968969
if (!sync) {
969970
cleanup();
970-
throw new ERR_INVALID_SYNC_FORK_INPUT(util.inspect(stdio));
971+
throw new ERR_INVALID_SYNC_FORK_INPUT(inspect(stdio));
971972
}
972973
} else {
973974
// Cleanup
974975
cleanup();
975-
throw new ERR_INVALID_OPT_VALUE('stdio', util.inspect(stdio));
976+
throw new ERR_INVALID_OPT_VALUE('stdio', inspect(stdio));
976977
}
977978

978979
return acc;

0 commit comments

Comments
 (0)