mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
stream: reduce internal usage of public require of util
PR-URL: https://github.com/nodejs/node/pull/26698 Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
f597b37efb
commit
b552139554
|
|
@ -1,11 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
const assert = require('internal/assert');
|
||||
const util = require('util');
|
||||
const { Socket } = require('net');
|
||||
const { JSStream } = internalBinding('js_stream');
|
||||
const uv = internalBinding('uv');
|
||||
const debug = util.debuglog('stream_socket');
|
||||
const debug = require('internal/util/debuglog').debuglog('stream_socket');
|
||||
const { owner_symbol } = require('internal/async_hooks').symbols;
|
||||
const { ERR_STREAM_WRAP } = require('internal/errors').codes;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const { Buffer } = require('buffer');
|
||||
const { inspect } = require('util');
|
||||
const { inspect } = require('internal/util/inspect');
|
||||
|
||||
function copyBuffer(src, target, offset) {
|
||||
Buffer.prototype.copy.call(src, target, offset);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
'use strict';
|
||||
|
||||
const stream = require('stream');
|
||||
const util = require('util');
|
||||
|
||||
const {
|
||||
getDefaultEncoding
|
||||
|
|
@ -17,7 +16,8 @@ function LazyTransform(options) {
|
|||
this.writable = true;
|
||||
this.readable = true;
|
||||
}
|
||||
util.inherits(LazyTransform, stream.Transform);
|
||||
Object.setPrototypeOf(LazyTransform.prototype, stream.Transform.prototype);
|
||||
Object.setPrototypeOf(LazyTransform, stream.Transform);
|
||||
|
||||
function makeGetter(name) {
|
||||
return function() {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ Stream.Stream = Stream;
|
|||
|
||||
// Internal utilities
|
||||
try {
|
||||
const types = require('util').types;
|
||||
const types = require('internal/util/types');
|
||||
if (types && typeof types.isUint8Array === 'function') {
|
||||
Stream._isUint8Array = types.isUint8Array;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user