Permalink
Browse files

lib: consolidate redundant require() calls

PR-URL: #21699
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
  • Loading branch information...
cjihrig committed Jul 7, 2018
1 parent d0b00a7 commit 573744caaedf2f941e152b8e9533cd5629d55c1c
@@ -25,12 +25,11 @@ const assert = require('assert').ok;
const Stream = require('stream');
const util = require('util');
const internalUtil = require('internal/util');
const internalHttp = require('internal/http');
const { outHeadersKey, utcDate } = require('internal/http');
const { Buffer } = require('buffer');
const common = require('_http_common');
const checkIsHttpToken = common._checkIsHttpToken;
const checkInvalidHeaderChar = common._checkInvalidHeaderChar;
const { outHeadersKey } = require('internal/http');
const {
defaultTriggerAsyncIdScope,
symbols: { async_id_symbol }
@@ -48,7 +47,6 @@ const {
} = require('internal/errors').codes;
const { CRLF, debug } = common;
const { utcDate } = internalHttp;
const kIsCorked = Symbol('isCorked');
@@ -1,7 +1,7 @@
'use strict';
const { AsyncWrap, Providers } = process.binding('async_wrap');
const { Buffer } = require('buffer');
const { Buffer, kMaxLength } = require('buffer');
const { randomBytes: _randomBytes } = process.binding('crypto');
const {
ERR_INVALID_ARG_TYPE,
@@ -10,7 +10,6 @@ const {
} = require('internal/errors').codes;
const { isArrayBufferView } = require('internal/util/types');
const { kMaxLength } = require('buffer');
const kMaxUint32 = 2 ** 32 - 1;
const kMaxPossibleLength = Math.min(kMaxLength, kMaxUint32);
@@ -2,7 +2,8 @@
/* eslint-disable no-use-before-define */
require('internal/util').assertCrypto();
const internalUtil = require('internal/util');
internalUtil.assertCrypto();
const { internalBinding } = require('internal/bootstrap/loaders');
const { async_id_symbol } = require('internal/async_hooks').symbols;
@@ -71,7 +72,7 @@ const { utcDate } = require('internal/http');
const {
promisify,
customInspectSymbol: kInspect
} = require('internal/util');
} = internalUtil;
const { isArrayBufferView } = require('internal/util/types');
const { defaultTriggerAsyncIdScope } = require('internal/async_hooks');
const { _connectionListener: httpConnectionListener } = http;
@@ -14,8 +14,9 @@ const fs = require('fs');
const { _makeLong } = require('path');
const { SafeMap } = require('internal/safe_globals');
const { URL } = require('url');
const debug = require('util').debuglog('esm');
const readFileAsync = require('util').promisify(fs.readFile);
const util = require('util');
const debug = util.debuglog('esm');
const readFileAsync = util.promisify(fs.readFile);
const readFileSync = fs.readFileSync;
const StringReplace = Function.call.bind(String.prototype.replace);
const JsonParse = JSON.parse;

0 comments on commit 573744c

Please sign in to comment.