Skip to content

Commit

Permalink
lib: use util.isAsyncFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS committed Sep 18, 2024
1 parent 157b675 commit 68aac9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/clock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { debug } = require('node:util');
const { debug, types } = require('node:util');
const { validateNumber } = require('./validators');

let debugBench = debug('benchmark', (fn) => {
Expand Down Expand Up @@ -199,7 +199,7 @@ const SyncFunction = function () {
}.constructor;

function createRunner(bench, recommendedCount) {
const isAsync = bench.fn.constructor === AsyncFunction;
const isAsync = types.isAsyncFunction(bench.fn);
const hasArg = bench.fn.length >= 1;

if (bench.fn.length > 1) {
Expand Down

0 comments on commit 68aac9a

Please sign in to comment.