lib: remove the use of util.isFunction
PR-URL: https://github.com/nodejs/node/pull/29566 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
90b5cdb9e4
commit
7fa03b54c8
@ -20,7 +20,6 @@ if (!hasInspector)
|
||||
|
||||
const EventEmitter = require('events');
|
||||
const { validateString } = require('internal/validators');
|
||||
const util = require('util');
|
||||
const { isMainThread } = require('worker_threads');
|
||||
|
||||
const {
|
||||
@ -86,7 +85,7 @@ class Session extends EventEmitter {
|
||||
|
||||
post(method, params, callback) {
|
||||
validateString(method, 'method');
|
||||
if (!callback && util.isFunction(params)) {
|
||||
if (!callback && typeof params === 'function') {
|
||||
callback = params;
|
||||
params = null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user