GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: consolidate redundant require() calls · nodejs/node@92d7921

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • _http_outgoing.js
    • internal
      • crypto
        • random.js
      • http2
        • core.js
      • modules/esm
        • translators.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/_http_outgoing.js‎

Copy file name to clipboardExpand all lines: lib/_http_outgoing.js
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ const assert = require('assert').ok;
2525
const Stream = require('stream');
2626
const util = require('util');
2727
const internalUtil = require('internal/util');
28-
const internalHttp = require('internal/http');
28+
const { outHeadersKey, utcDate } = require('internal/http');
2929
const { Buffer } = require('buffer');
3030
const common = require('_http_common');
3131
const checkIsHttpToken = common._checkIsHttpToken;
3232
const checkInvalidHeaderChar = common._checkInvalidHeaderChar;
33-
const { outHeadersKey } = require('internal/http');
3433
const {
3534
defaultTriggerAsyncIdScope,
3635
symbols: { async_id_symbol }
@@ -48,7 +47,6 @@ const {
4847
} = require('internal/errors').codes;
4948

5049
const { CRLF, debug } = common;
51-
const { utcDate } = internalHttp;
5250

5351
const kIsCorked = Symbol('isCorked');
5452

Collapse file

‎lib/internal/crypto/random.js‎

Copy file name to clipboardExpand all lines: lib/internal/crypto/random.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const { AsyncWrap, Providers } = process.binding('async_wrap');
4-
const { Buffer } = require('buffer');
4+
const { Buffer, kMaxLength } = require('buffer');
55
const { randomBytes: _randomBytes } = process.binding('crypto');
66
const {
77
ERR_INVALID_ARG_TYPE,
@@ -10,7 +10,6 @@ const {
1010
} = require('internal/errors').codes;
1111
const { isArrayBufferView } = require('internal/util/types');
1212

13-
const { kMaxLength } = require('buffer');
1413
const kMaxUint32 = 2 ** 32 - 1;
1514
const kMaxPossibleLength = Math.min(kMaxLength, kMaxUint32);
1615

Collapse file

‎lib/internal/http2/core.js‎

Copy file name to clipboardExpand all lines: lib/internal/http2/core.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
/* eslint-disable no-use-before-define */
44

5-
require('internal/util').assertCrypto();
5+
const internalUtil = require('internal/util');
6+
internalUtil.assertCrypto();
67

78
const { internalBinding } = require('internal/bootstrap/loaders');
89
const { async_id_symbol } = require('internal/async_hooks').symbols;
@@ -71,7 +72,7 @@ const { utcDate } = require('internal/http');
7172
const {
7273
promisify,
7374
customInspectSymbol: kInspect
74-
} = require('internal/util');
75+
} = internalUtil;
7576
const { isArrayBufferView } = require('internal/util/types');
7677
const { defaultTriggerAsyncIdScope } = require('internal/async_hooks');
7778
const { _connectionListener: httpConnectionListener } = http;
Collapse file

‎lib/internal/modules/esm/translators.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/translators.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ const fs = require('fs');
1414
const { _makeLong } = require('path');
1515
const { SafeMap } = require('internal/safe_globals');
1616
const { URL } = require('url');
17-
const debug = require('util').debuglog('esm');
18-
const readFileAsync = require('util').promisify(fs.readFile);
17+
const util = require('util');
18+
const debug = util.debuglog('esm');
19+
const readFileAsync = util.promisify(fs.readFile);
1920
const readFileSync = fs.readFileSync;
2021
const StringReplace = Function.call.bind(String.prototype.replace);
2122
const JsonParse = JSON.parse;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.