fix: no-arg console.log is undefined (#22165)
This commit is contained in:
parent
d1fd237e61
commit
5e7c594691
1 changed files with 4 additions and 2 deletions
|
@ -18,8 +18,10 @@ require('@electron/internal/common/init')
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
// Redirect node's console to use our own implementations, since node can not
|
// Redirect node's console to use our own implementations, since node can not
|
||||||
// handle console output when running as GUI program.
|
// handle console output when running as GUI program.
|
||||||
const consoleLog = (format: any, ...args: any[]) => {
|
const consoleLog = (...args: any[]) => {
|
||||||
return process.log(util.format(format, ...args) + '\n')
|
// @ts-ignore this typing is incorrect; 'format' is an optional parameter
|
||||||
|
// See https://nodejs.org/api/util.html#util_util_format_format_args
|
||||||
|
return process.log(util.format(...args) + '\n')
|
||||||
}
|
}
|
||||||
const streamWrite: NodeJS.WritableStream['write'] = function (chunk: Buffer | string, encoding?: any, callback?: Function) {
|
const streamWrite: NodeJS.WritableStream['write'] = function (chunk: Buffer | string, encoding?: any, callback?: Function) {
|
||||||
if (Buffer.isBuffer(chunk)) {
|
if (Buffer.isBuffer(chunk)) {
|
||||||
|
|
Loading…
Reference in a new issue