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 <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
tniessen committed Mar 22, 2018
1 parent 49b2969 commit e714da6
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 e714da6

Please sign in to comment.