From 07d3c55ecac5fd84d16b272bb233771336f35177 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 30 May 2018 03:41:57 +0000 Subject: [PATCH] benchmark: refactor deepequal-object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a minor refactor of benchmark/assert/deepequal-object.js to reduce exceptions that need to be made for lint compliance. PR-URL: https://github.com/nodejs/node/pull/21030 Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat --- benchmark/assert/deepequal-object.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmark/assert/deepequal-object.js b/benchmark/assert/deepequal-object.js index 4c95006b3b8..124943b19ec 100644 --- a/benchmark/assert/deepequal-object.js +++ b/benchmark/assert/deepequal-object.js @@ -29,13 +29,15 @@ function main({ size, n, method }) { // TODO: Fix this "hack". `n` should not be manipulated. n = n / size; + if (!method) + method = 'deepEqual'; + const source = Array.apply(null, Array(size)); const actual = createObj(source); const expected = createObj(source); const expectedWrong = createObj(source, '4'); - // eslint-disable-next-line no-restricted-properties - const fn = method !== '' ? assert[method] : assert.deepEqual; + const fn = assert[method]; const value2 = method.includes('not') ? expectedWrong : expected; bench.start();