Skip to content

Commit b351e0e

Browse files
tniessentargos
authored andcommitted
http: use more destructuring
PR-URL: #19481 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jackson Tian <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent e9f41ee commit b351e0e

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

lib/http.js

+18-15
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121

2222
'use strict';
2323

24-
const agent = require('_http_agent');
24+
const { Agent, globalAgent } = require('_http_agent');
2525
const { ClientRequest } = require('_http_client');
26-
const common = require('_http_common');
27-
const incoming = require('_http_incoming');
28-
const outgoing = require('_http_outgoing');
29-
const server = require('_http_server');
30-
31-
const { Server } = server;
26+
const { methods } = require('_http_common');
27+
const { IncomingMessage } = require('_http_incoming');
28+
const { OutgoingMessage } = require('_http_outgoing');
29+
const {
30+
_connectionListener,
31+
STATUS_CODES,
32+
Server,
33+
ServerResponse
34+
} = require('_http_server');
3235

3336
function createServer(requestListener) {
3437
return new Server(requestListener);
@@ -45,16 +48,16 @@ function get(options, cb) {
4548
}
4649

4750
module.exports = {
48-
_connectionListener: server._connectionListener,
49-
METHODS: common.methods.slice().sort(),
50-
STATUS_CODES: server.STATUS_CODES,
51-
Agent: agent.Agent,
51+
_connectionListener,
52+
METHODS: methods.slice().sort(),
53+
STATUS_CODES,
54+
Agent,
5255
ClientRequest,
53-
globalAgent: agent.globalAgent,
54-
IncomingMessage: incoming.IncomingMessage,
55-
OutgoingMessage: outgoing.OutgoingMessage,
56+
globalAgent,
57+
IncomingMessage,
58+
OutgoingMessage,
5659
Server,
57-
ServerResponse: server.ServerResponse,
60+
ServerResponse,
5861
createServer,
5962
get,
6063
request

0 commit comments

Comments
 (0)