Skip to content

Commit 1500e5d

Browse files
dnlupZYSzys
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 c8d3a73 commit 1500e5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: lib/internal/child_process.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const { validateString } = require('internal/validators');
1818
const EventEmitter = require('events');
1919
const net = require('net');
2020
const dgram = require('dgram');
21-
const util = require('util');
21+
const inspect = require('internal/util/inspect').inspect;
2222
const assert = require('internal/assert');
2323

2424
const { Process } = internalBinding('process_wrap');
@@ -887,7 +887,7 @@ function _validateStdio(stdio, sync) {
887887
throw new ERR_INVALID_OPT_VALUE('stdio', stdio);
888888
}
889889
} else if (!Array.isArray(stdio)) {
890-
throw new ERR_INVALID_OPT_VALUE('stdio', util.inspect(stdio));
890+
throw new ERR_INVALID_OPT_VALUE('stdio', inspect(stdio));
891891
}
892892

893893
// At least 3 stdio will be created
@@ -967,12 +967,12 @@ function _validateStdio(stdio, sync) {
967967
} else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
968968
if (!sync) {
969969
cleanup();
970-
throw new ERR_INVALID_SYNC_FORK_INPUT(util.inspect(stdio));
970+
throw new ERR_INVALID_SYNC_FORK_INPUT(inspect(stdio));
971971
}
972972
} else {
973973
// Cleanup
974974
cleanup();
975-
throw new ERR_INVALID_OPT_VALUE('stdio', util.inspect(stdio));
975+
throw new ERR_INVALID_OPT_VALUE('stdio', inspect(stdio));
976976
}
977977

978978
return acc;

0 commit comments

Comments
 (0)