Skip to content

Commit a383aee

Browse files
aduh95danielleadams
authored andcommitted
benchmark: add trailing commas in benchmark/url
PR-URL: #46551 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent a10c355 commit a383aee

15 files changed

+28
-29
lines changed

benchmark/.eslintrc.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ overrides:
1212
- crypto/*.js
1313
- http/*.js
1414
- path/*.js
15-
- url/*.js
1615
rules:
1716
comma-dangle: [error, {
1817
arrays: always-multiline,

benchmark/url/legacy-vs-whatwg-url-get-prop.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const assert = require('assert');
77
const bench = common.createBenchmark(main, {
88
type: common.urlDataTypes,
99
method: ['legacy', 'whatwg'],
10-
e: [1]
10+
e: [1],
1111
});
1212

1313
function useLegacy(data) {
@@ -20,7 +20,7 @@ function useLegacy(data) {
2020
port: obj.port,
2121
pathname: obj.pathname,
2222
search: obj.search,
23-
hash: obj.hash
23+
hash: obj.hash,
2424
};
2525
const len = data.length;
2626
// It's necessary to assign the values to an object
@@ -51,7 +51,7 @@ function useWHATWG(data) {
5151
port: obj.port,
5252
pathname: obj.pathname,
5353
search: obj.search,
54-
hash: obj.hash
54+
hash: obj.hash,
5555
};
5656
const len = data.length;
5757
bench.start();

benchmark/url/legacy-vs-whatwg-url-parse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
88
withBase: ['true', 'false'],
99
type: common.urlDataTypes,
1010
e: [1],
11-
method: ['legacy', 'whatwg']
11+
method: ['legacy', 'whatwg'],
1212
});
1313

1414
function useLegacy(data) {

benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const searchParams = common.searchParams;
66
const bench = common.createBenchmark(main, {
77
searchParam: Object.keys(searchParams),
88
method: ['legacy', 'whatwg'],
9-
n: [1e6]
9+
n: [1e6],
1010
});
1111

1212
function useLegacy(n, input) {

benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const searchParams = common.searchParams;
66
const bench = common.createBenchmark(main, {
77
searchParam: Object.keys(searchParams),
88
method: ['legacy', 'whatwg'],
9-
n: [1e6]
9+
n: [1e6],
1010
});
1111

1212
function useLegacy(n, input, prop) {

benchmark/url/legacy-vs-whatwg-url-serialize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const assert = require('assert');
77
const bench = common.createBenchmark(main, {
88
type: common.urlDataTypes,
99
method: ['legacy', 'whatwg'],
10-
e: [1]
10+
e: [1],
1111
});
1212

1313
function useLegacy(data) {

benchmark/url/url-format.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const inputs = {
99

1010
const bench = common.createBenchmark(main, {
1111
type: Object.keys(inputs),
12-
n: [25e6]
12+
n: [25e6],
1313
});
1414

1515
function main({ type, n }) {

benchmark/url/url-parse.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ const url = require('url');
44

55
const inputs = {
66
normal: 'http://foo.com/bar',
7-
escaped: 'https://foo.bar/{}^`/abcd'
7+
escaped: 'https://foo.bar/{}^`/abcd',
88
};
99

1010
const bench = common.createBenchmark(main, {
1111
type: Object.keys(inputs),
12-
n: [1e7]
12+
n: [1e7],
1313
});
1414

1515
function main({ type, n }) {

benchmark/url/url-resolve.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ const paths = {
99
'sibling': '../foo/bar?baz=boom',
1010
'foo/bar': 'foo/bar',
1111
'withscheme': 'http://nodejs.org',
12-
'down': './foo/bar?baz'
12+
'down': './foo/bar?baz',
1313
};
1414

1515
const bench = common.createBenchmark(main, {
1616
href: Object.keys(hrefs),
1717
path: Object.keys(paths),
18-
n: [1e5]
18+
n: [1e5],
1919
});
2020

2121
function main({ n, href, path }) {

benchmark/url/url-searchparams-iteration.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const assert = require('assert');
44

55
const bench = common.createBenchmark(main, {
66
loopMethod: ['forEach', 'iterator'],
7-
n: [1e6]
7+
n: [1e6],
88
});
99

1010
const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd';

benchmark/url/url-searchparams-read.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const common = require('../common.js');
44
const bench = common.createBenchmark(main, {
55
accessMethod: ['get', 'getAll', 'has'],
66
param: ['one', 'two', 'three', 'nonexistent'],
7-
n: [2e7]
7+
n: [2e7],
88
});
99

1010
const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd';

benchmark/url/url-searchparams-sort.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const inputs = {
1313
// 88 parameters
1414
long: 'g&r&t&h&s&r&d&w&b&n&h&k&x&m&k&h&o&e&x&c&c&g&e&b&p&p&s&n&j&b&y&z&' +
1515
'u&l&o&r&w&a&u&l&m&f&j&q&p&f&e&y&e&n&e&l&m&w&u&w&t&n&t&q&v&y&c&o&' +
16-
'k&f&j&i&l&m&g&j&d&i&z&q&p&x&q&q&d&n&y&w&g&i&v&r'
16+
'k&f&j&i&l&m&g&j&d&i&z&q&p&x&q&q&d&n&y&w&g&i&v&r',
1717
};
1818

1919
function getParams(str) {
@@ -26,9 +26,9 @@ function getParams(str) {
2626

2727
const bench = common.createBenchmark(main, {
2828
type: Object.keys(inputs),
29-
n: [1e6]
29+
n: [1e6],
3030
}, {
31-
flags: ['--expose-internals']
31+
flags: ['--expose-internals'],
3232
});
3333

3434
function main({ type, n }) {

benchmark/url/usvstring.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ const inputs = {
77
'\ud800\udfff',
88
someinvalid: 'asasfdfasd\uda23',
99
allinvalid: '\udc45\uda23 \udf00\udc00 \udfaa\uda12 \udc00\udfaa',
10-
nonstring: { toString() { return 'asdf'; } }
10+
nonstring: { toString() { return 'asdf'; } },
1111
};
1212
const bench = common.createBenchmark(main, {
1313
input: Object.keys(inputs),
14-
n: [5e7]
14+
n: [5e7],
1515
}, {
16-
flags: ['--expose-internals']
16+
flags: ['--expose-internals'],
1717
});
1818

1919
function main({ input, n }) {

benchmark/url/whatwg-url-idna.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ const { domainToASCII, domainToUnicode } = require('url');
55
const domains = {
66
empty: {
77
ascii: '',
8-
unicode: ''
8+
unicode: '',
99
},
1010
none: {
1111
ascii: 'passports',
12-
unicode: 'passports'
12+
unicode: 'passports',
1313
},
1414
some: {
1515
ascii: 'Paßstraße',
16-
unicode: 'xn--Pastrae-1vae'
16+
unicode: 'xn--Pastrae-1vae',
1717
},
1818
all: {
1919
ascii: '他们不说中文',
20-
unicode: 'xn--ihqwczyycu19kkg2c'
20+
unicode: 'xn--ihqwczyycu19kkg2c',
2121
},
2222
nonstring: {
2323
ascii: { toString() { return ''; } },
24-
unicode: { toString() { return ''; } }
25-
}
24+
unicode: { toString() { return ''; } },
25+
},
2626
};
2727

2828
const bench = common.createBenchmark(main, {
2929
domain: Object.keys(domains),
3030
to: ['ascii', 'unicode'],
31-
n: [5e6]
31+
n: [5e6],
3232
});
3333

3434
function main({ n, to, domain }) {

benchmark/url/whatwg-url-properties.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
77
e: [1],
88
prop: ['href', 'origin', 'protocol',
99
'username', 'password', 'host', 'hostname', 'port',
10-
'pathname', 'search', 'searchParams', 'hash']
10+
'pathname', 'search', 'searchParams', 'hash'],
1111
});
1212

1313
function setAndGet(data, prop) {

0 commit comments

Comments
 (0)