Skip to content

Commit 6b26012

Browse files
committed
refactor benchmark utility for isError function to improve readability
1 parent f2e53f1 commit 6b26012

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

benchmark/util/is-error.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ const bench = common.createBenchmark(
1414
argument: ['true'],
1515
version: ['instanceof', 'isError'],
1616
n: [1e6],
17-
}
17+
},
1818
);
1919

2020
function main({ argument, version, n }) {
2121
const arg = args[argument];
22-
const func = version === 'isError'
23-
? Error.isError
24-
: (v) => v instanceof Error;
22+
const func = version === 'isError' ? Error.isError : (v) => v instanceof Error;
2523

2624
bench.start();
2725
let result;

0 commit comments

Comments
 (0)