Skip to content

Commit

Permalink
http: use more destructuring
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
tniessen authored and targos committed Mar 24, 2018
1 parent e9f41ee commit b351e0e
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@

'use strict';

const agent = require('_http_agent');
const { Agent, globalAgent } = require('_http_agent');
const { ClientRequest } = require('_http_client');
const common = require('_http_common');
const incoming = require('_http_incoming');
const outgoing = require('_http_outgoing');
const server = require('_http_server');

const { Server } = server;
const { methods } = require('_http_common');
const { IncomingMessage } = require('_http_incoming');
const { OutgoingMessage } = require('_http_outgoing');
const {
_connectionListener,
STATUS_CODES,
Server,
ServerResponse
} = require('_http_server');

function createServer(requestListener) {
return new Server(requestListener);
Expand All @@ -45,16 +48,16 @@ function get(options, cb) {
}

module.exports = {
_connectionListener: server._connectionListener,
METHODS: common.methods.slice().sort(),
STATUS_CODES: server.STATUS_CODES,
Agent: agent.Agent,
_connectionListener,
METHODS: methods.slice().sort(),
STATUS_CODES,
Agent,
ClientRequest,
globalAgent: agent.globalAgent,
IncomingMessage: incoming.IncomingMessage,
OutgoingMessage: outgoing.OutgoingMessage,
globalAgent,
IncomingMessage,
OutgoingMessage,
Server,
ServerResponse: server.ServerResponse,
ServerResponse,
createServer,
get,
request
Expand Down

0 comments on commit b351e0e

Please sign in to comment.