benchmark: add trailing commas in benchmark/util

PR-URL: https://github.com/nodejs/node/pull/46438
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Antoine du Hamel 2023-02-03 11:42:25 +01:00 committed by GitHub
parent 75dca44c60
commit 83cc1e2c8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 17 additions and 18 deletions

View file

@ -20,7 +20,6 @@ overrides:
- path/*.js
- process/*.js
- url/*.js
- util/*.js
rules:
comma-dangle: [error, {
arrays: always-multiline,

View file

@ -19,7 +19,7 @@ const inputs = {
const bench = common.createBenchmark(main, {
n: [1e5],
type: Object.keys(inputs)
type: Object.keys(inputs),
});
function main({ n, type }) {

View file

@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, {
'sparseArray',
'mixedArray',
'denseArray_showHidden',
]
],
});
function main({ n, len, type }) {

View file

@ -6,7 +6,7 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
n: [1e5],
showProxy: [0, 1],
isProxy: [0, 1]
isProxy: [0, 1],
});
function main({ n, showProxy, isProxy }) {

View file

@ -6,7 +6,7 @@ const common = require('../common.js');
const opts = {
showHidden: { showHidden: true },
colors: { colors: true },
none: undefined
none: undefined,
};
const bench = common.createBenchmark(main, {
n: [2e4],
@ -25,7 +25,7 @@ const bench = common.createBenchmark(main, {
'TypedArray_extra',
'Number',
],
option: Object.keys(opts)
option: Object.keys(opts),
});
function benchmark(n, obj, options) {

View file

@ -9,7 +9,7 @@ const groupedInputs = {
group_upper: ['UTF-8', 'UTF8', 'UCS2',
'UTF16LE', 'BASE64', 'UCS2'],
group_uncommon: ['foo'],
group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY']
group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY'],
};
const inputs = [
@ -21,9 +21,9 @@ const inputs = [
const bench = common.createBenchmark(main, {
input: inputs.concat(Object.keys(groupedInputs)),
n: [1e5]
n: [1e5],
}, {
flags: '--expose-internals'
flags: '--expose-internals',
});
function getInput(input) {

View file

@ -3,7 +3,7 @@
const common = require('../common');
const bench = common.createBenchmark(main, {
n: [1e5]
n: [1e5],
}, { flags: ['--expose-internals'] });
function main({ n, type }) {

View file

@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
fatal: [0, 1],
len: [256, 1024 * 16, 1024 * 512],
n: [1e2],
type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer']
type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer'],
});
function main({ encoding, len, n, ignoreBOM, type, fatal }) {

View file

@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, {
len: [16, 32, 256, 1024, 1024 * 32],
n: [1e4],
type: ['one-byte-string', 'two-byte-string', 'ascii'],
op: ['encode', 'encodeInto']
op: ['encode', 'encodeInto'],
});
function main({ n, op, len, type }) {

View file

@ -11,27 +11,27 @@ const args = {
ArrayBufferView: {
'true': dataView,
'false-primitive': true,
'false-object': arrayBuffer
'false-object': arrayBuffer,
},
TypedArray: {
'true': int32Array,
'false-primitive': true,
'false-object': arrayBuffer
'false-object': arrayBuffer,
},
Uint8Array: {
'true': uint8Array,
'false-primitive': true,
'false-object': int32Array
}
'false-object': int32Array,
},
};
const bench = common.createBenchmark(main, {
type: Object.keys(args),
version: ['native', 'js'],
argument: ['true', 'false-primitive', 'false-object'],
n: [1e5]
n: [1e5],
}, {
flags: ['--expose-internals', '--no-warnings']
flags: ['--expose-internals', '--no-warnings'],
});
function main({ type, argument, version, n }) {