Skip to content

Commit 4d71442

Browse files
TrottMylesBorins
authored andcommitted
benchmark: refactor deepequal-object
This is a minor refactor of benchmark/assert/deepequal-object.js to reduce exceptions that need to be made for lint compliance. PR-URL: #21030 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 9b0fc59 commit 4d71442

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

benchmark/assert/deepequal-object.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ function main({ size, n, method }) {
2929
// TODO: Fix this "hack". `n` should not be manipulated.
3030
n = n / size;
3131

32+
if (!method)
33+
method = 'deepEqual';
34+
3235
const source = Array.apply(null, Array(size));
3336
const actual = createObj(source);
3437
const expected = createObj(source);
3538
const expectedWrong = createObj(source, '4');
3639

37-
// eslint-disable-next-line no-restricted-properties
38-
const fn = method !== '' ? assert[method] : assert.deepEqual;
40+
const fn = assert[method];
3941
const value2 = method.includes('not') ? expectedWrong : expected;
4042

4143
bench.start();

0 commit comments

Comments
 (0)