Skip to content

Commit f914bff

Browse files
aduh95targos
authored andcommitted
lib: add trailing commas to more internal files
PR-URL: #46811 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 48cf984 commit f914bff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+171
-176
lines changed

lib/.eslintrc.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,8 @@ globals:
263263
primordials: false
264264
overrides:
265265
- files:
266-
- ./*/promises.js
267-
- ./_stream_*.js
268-
- ./_tls_common.js
269-
- ./assert/*.js
266+
- ./*/*.js
267+
- ./_*.js
270268
- ./child_process.js
271269
- ./cluster.js
272270
- ./console.js
@@ -288,7 +286,7 @@ overrides:
288286
- ./internal/js_stream_socket.js
289287
- ./internal/mime.js
290288
- ./internal/modules/*.js
291-
- ./internal/per_context/messageport.js
289+
- ./internal/per_context/*.js
292290
- ./internal/perf/*.js
293291
- ./internal/policy/*.js
294292
- ./internal/priority_queue.js
@@ -297,7 +295,7 @@ overrides:
297295
- ./internal/readme.md
298296
- ./internal/repl.js
299297
- ./internal/repl/*.js
300-
- ./internal/source_map/prepare_stack_trace.js
298+
- ./internal/source_map/*.js
301299
- ./internal/streams/*.js
302300
- ./internal/structured_clone.js
303301
- ./internal/test/*.js
@@ -310,15 +308,12 @@ overrides:
310308
- ./internal/webidl.js
311309
- ./internal/webstreams/*.js
312310
- ./module.js
313-
- ./path/*.js
314311
- ./process.js
315312
- ./punycode.js
316313
- ./repl.js
317-
- ./stream/*.js
318314
- ./sys.js
319315
- ./test.js
320316
- ./tls.js
321317
- ./url.js
322-
- ./util/*.js
323318
rules:
324319
comma-dangle: [error, always-multiline]

lib/_http_agent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */,
245245
__proto__: null,
246246
host: options,
247247
port,
248-
localAddress
248+
localAddress,
249249
};
250250
}
251251

@@ -551,5 +551,5 @@ function asyncResetHandle(socket) {
551551

552552
module.exports = {
553553
Agent,
554-
globalAgent: new Agent({ keepAlive: true, scheduling: 'lifo', timeout: 5000 })
554+
globalAgent: new Agent({ keepAlive: true, scheduling: 'lifo', timeout: 5000 }),
555555
};

lib/_http_client.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const {
5858
const {
5959
kUniqueHeaders,
6060
parseUniqueHeadersOption,
61-
OutgoingMessage
61+
OutgoingMessage,
6262
} = require('_http_outgoing');
6363
const Agent = require('_http_agent');
6464
const { Buffer } = require('buffer');
@@ -78,7 +78,7 @@ const {
7878
ERR_INVALID_ARG_TYPE,
7979
ERR_INVALID_HTTP_TOKEN,
8080
ERR_INVALID_PROTOCOL,
81-
ERR_UNESCAPED_CHARACTERS
81+
ERR_UNESCAPED_CHARACTERS,
8282
} = codes;
8383
const {
8484
validateInteger,
@@ -644,7 +644,7 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
644644
httpVersionMajor: res.httpVersionMajor,
645645
httpVersionMinor: res.httpVersionMinor,
646646
headers: res.headers,
647-
rawHeaders: res.rawHeaders
647+
rawHeaders: res.rawHeaders,
648648
});
649649

650650
return 1; // Skip body but don't treat as Upgrade.
@@ -970,5 +970,5 @@ ClientRequest.prototype.clearTimeout = function clearTimeout(cb) {
970970
};
971971

972972
module.exports = {
973-
ClientRequest
973+
ClientRequest,
974974
};

lib/_http_common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const incoming = require('_http_incoming');
3737
const {
3838
IncomingMessage,
3939
readStart,
40-
readStop
40+
readStop,
4141
} = incoming;
4242

4343
const kIncomingMessage = Symbol('IncomingMessage');

lib/_http_incoming.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const {
2727
StringPrototypeCharCodeAt,
2828
StringPrototypeSlice,
2929
StringPrototypeToLowerCase,
30-
Symbol
30+
Symbol,
3131
} = primordials;
3232

3333
const { Readable, finished } = require('stream');
@@ -55,7 +55,7 @@ function IncomingMessage(socket) {
5555

5656
if (socket) {
5757
streamOptions = {
58-
highWaterMark: socket.readableHighWaterMark
58+
highWaterMark: socket.readableHighWaterMark,
5959
};
6060
}
6161

@@ -104,7 +104,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'connection', {
104104
},
105105
set: function(val) {
106106
this.socket = val;
107-
}
107+
},
108108
});
109109

110110
ObjectDefineProperty(IncomingMessage.prototype, 'headers', {
@@ -124,7 +124,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'headers', {
124124
},
125125
set: function(val) {
126126
this[kHeaders] = val;
127-
}
127+
},
128128
});
129129

130130
ObjectDefineProperty(IncomingMessage.prototype, 'headersDistinct', {
@@ -144,7 +144,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'headersDistinct', {
144144
},
145145
set: function(val) {
146146
this[kHeadersDistinct] = val;
147-
}
147+
},
148148
});
149149

150150
ObjectDefineProperty(IncomingMessage.prototype, 'trailers', {
@@ -164,7 +164,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'trailers', {
164164
},
165165
set: function(val) {
166166
this[kTrailers] = val;
167-
}
167+
},
168168
});
169169

170170
ObjectDefineProperty(IncomingMessage.prototype, 'trailersDistinct', {
@@ -184,7 +184,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'trailersDistinct', {
184184
},
185185
set: function(val) {
186186
this[kTrailersDistinct] = val;
187-
}
187+
},
188188
});
189189

190190
IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
@@ -452,5 +452,5 @@ function onError(self, error, cb) {
452452
module.exports = {
453453
IncomingMessage,
454454
readStart,
455-
readStop
455+
readStop,
456456
};

lib/_http_outgoing.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const {
5252
} = require('_http_common');
5353
const {
5454
defaultTriggerAsyncIdScope,
55-
symbols: { async_id_symbol }
55+
symbols: { async_id_symbol },
5656
} = require('internal/async_hooks');
5757
const {
5858
codes: {
@@ -69,9 +69,9 @@ const {
6969
ERR_STREAM_ALREADY_FINISHED,
7070
ERR_STREAM_WRITE_AFTER_END,
7171
ERR_STREAM_NULL_VALUES,
72-
ERR_STREAM_DESTROYED
72+
ERR_STREAM_DESTROYED,
7373
},
74-
hideStackFrames
74+
hideStackFrames,
7575
} = require('internal/errors');
7676
const { validateString } = require('internal/validators');
7777
const { isUint8Array } = require('internal/util/types');
@@ -176,36 +176,36 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'writableFinished', {
176176
this.outputSize === 0 &&
177177
(!this.socket || this.socket.writableLength === 0)
178178
);
179-
}
179+
},
180180
});
181181

182182
ObjectDefineProperty(OutgoingMessage.prototype, 'writableObjectMode', {
183183
__proto__: null,
184184
get() {
185185
return false;
186-
}
186+
},
187187
});
188188

189189
ObjectDefineProperty(OutgoingMessage.prototype, 'writableLength', {
190190
__proto__: null,
191191
get() {
192192
return this.outputSize + (this.socket ? this.socket.writableLength : 0);
193-
}
193+
},
194194
});
195195

196196
ObjectDefineProperty(OutgoingMessage.prototype, 'writableHighWaterMark', {
197197
__proto__: null,
198198
get() {
199199
return this.socket ? this.socket.writableHighWaterMark : HIGH_WATER_MARK;
200-
}
200+
},
201201
});
202202

203203
ObjectDefineProperty(OutgoingMessage.prototype, 'writableCorked', {
204204
__proto__: null,
205205
get() {
206206
const corked = this.socket ? this.socket.writableCorked : 0;
207207
return corked + this[kCorked];
208-
}
208+
},
209209
});
210210

211211
ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
@@ -226,7 +226,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headers', {
226226
headers[StringPrototypeToLowerCase(name)] = [name, val[name]];
227227
}
228228
}
229-
}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066')
229+
}, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066'),
230230
});
231231

232232
ObjectDefineProperty(OutgoingMessage.prototype, 'connection', {
@@ -236,7 +236,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'connection', {
236236
},
237237
set: function(val) {
238238
this.socket = val;
239-
}
239+
},
240240
});
241241

242242
ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
@@ -271,7 +271,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', {
271271
header[0] = val[keys[i]];
272272
}
273273
}
274-
}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066')
274+
}, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066'),
275275
});
276276

277277

@@ -367,7 +367,7 @@ OutgoingMessage.prototype._send = function _send(data, encoding, callback, byteL
367367
this.outputData.unshift({
368368
data: header,
369369
encoding: 'latin1',
370-
callback: null
370+
callback: null,
371371
});
372372
this.outputSize += header.length;
373373
this._onPendingData(header.length);
@@ -418,7 +418,7 @@ function _storeHeader(firstLine, headers) {
418418
date: false,
419419
expect: false,
420420
trailer: false,
421-
header: firstLine
421+
header: firstLine,
422422
};
423423

424424
if (headers) {
@@ -805,19 +805,19 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'headersSent', {
805805
__proto__: null,
806806
configurable: true,
807807
enumerable: true,
808-
get: function() { return !!this._header; }
808+
get: function() { return !!this._header; },
809809
});
810810

811811
ObjectDefineProperty(OutgoingMessage.prototype, 'writableEnded', {
812812
__proto__: null,
813-
get: function() { return this.finished; }
813+
get: function() { return this.finished; },
814814
});
815815

816816
ObjectDefineProperty(OutgoingMessage.prototype, 'writableNeedDrain', {
817817
__proto__: null,
818818
get: function() {
819819
return !this.destroyed && !this.finished && this[kNeedDrain];
820-
}
820+
},
821821
});
822822

823823
const crlf_buf = Buffer.from('\r\n');
@@ -1170,5 +1170,5 @@ module.exports = {
11701170
parseUniqueHeadersOption,
11711171
validateHeaderName,
11721172
validateHeaderValue,
1173-
OutgoingMessage
1173+
OutgoingMessage,
11741174
};

lib/_http_server.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const { ConnectionsList } = internalBinding('http_parser');
5151
const {
5252
kUniqueHeaders,
5353
parseUniqueHeadersOption,
54-
OutgoingMessage
54+
OutgoingMessage,
5555
} = require('_http_outgoing');
5656
const {
5757
kOutHeaders,
@@ -63,12 +63,12 @@ const {
6363
} = require('internal/http');
6464
const {
6565
defaultTriggerAsyncIdScope,
66-
getOrSetAsyncId
66+
getOrSetAsyncId,
6767
} = require('internal/async_hooks');
6868
const { IncomingMessage } = require('_http_incoming');
6969
const {
7070
connResetException,
71-
codes
71+
codes,
7272
} = require('internal/errors');
7373
const {
7474
ERR_HTTP_REQUEST_TIMEOUT,
@@ -77,13 +77,13 @@ const {
7777
ERR_HTTP_SOCKET_ENCODING,
7878
ERR_INVALID_ARG_TYPE,
7979
ERR_INVALID_ARG_VALUE,
80-
ERR_INVALID_CHAR
80+
ERR_INVALID_CHAR,
8181
} = codes;
8282
const {
8383
validateInteger,
8484
validateBoolean,
8585
validateLinkHeaderValue,
86-
validateObject
86+
validateObject,
8787
} = require('internal/validators');
8888
const Buffer = require('buffer').Buffer;
8989
const { setInterval, clearInterval } = require('timers');
@@ -167,7 +167,7 @@ const STATUS_CODES = {
167167
508: 'Loop Detected', // RFC 5842 7.2
168168
509: 'Bandwidth Limit Exceeded',
169169
510: 'Not Extended', // RFC 2774 7
170-
511: 'Network Authentication Required' // RFC 6585 6
170+
511: 'Network Authentication Required', // RFC 6585 6
171171
};
172172

173173
const kOnExecute = HTTPParser.kOnExecute | 0;
@@ -654,7 +654,7 @@ function connectionListenerInternal(server, socket) {
654654
// sent to the client.
655655
outgoingData: 0,
656656
requestsCount: 0,
657-
keepAliveTimeoutSet: false
657+
keepAliveTimeoutSet: false,
658658
};
659659
state.onData = socketOnData.bind(undefined,
660660
server, socket, parser, state);
@@ -913,7 +913,7 @@ function resOnFinish(req, res, socket, state, server) {
913913
request: req,
914914
response: res,
915915
socket,
916-
server
916+
server,
917917
});
918918
}
919919

@@ -1005,7 +1005,7 @@ function parserOnIncoming(server, socket, state, req, keepAlive) {
10051005
request: req,
10061006
response: res,
10071007
socket,
1008-
server
1008+
server,
10091009
});
10101010
}
10111011

@@ -1138,5 +1138,5 @@ module.exports = {
11381138
setupConnectionsTracking,
11391139
storeHTTPOptions,
11401140
_connectionListener: connectionListener,
1141-
kServerResponse
1141+
kServerResponse,
11421142
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy