File tree 1 file changed +1
-23
lines changed
1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change 21
21
22
22
'use strict' ;
23
23
24
- const { Object } = primordials ;
25
-
26
24
const { Buffer } = require ( 'buffer' ) ;
27
25
const pipeline = require ( 'internal/streams/pipeline' ) ;
28
26
const eos = require ( 'internal/streams/end-of-stream' ) ;
@@ -43,27 +41,7 @@ Stream.finished = eos;
43
41
// Backwards-compat with node 0.4.x
44
42
Stream . Stream = Stream ;
45
43
46
- // Internal utilities
47
- try {
48
- const types = require ( 'internal/util/types' ) ;
49
- if ( types && typeof types . isUint8Array === 'function' ) {
50
- Stream . _isUint8Array = types . isUint8Array ;
51
- } else {
52
- // This throws for Node < 4.2.0 because there's no util binding and
53
- // returns undefined for Node < 7.4.0.
54
- // Please do not convert process.binding() to internalBinding() here.
55
- // This is for compatibility with older versions when loaded as
56
- // readable-stream.
57
- Stream . _isUint8Array = process . binding ( 'util' ) . isUint8Array ;
58
- }
59
- } catch ( e ) { // eslint-disable-line no-unused-vars
60
- }
61
-
62
- if ( ! Stream . _isUint8Array ) {
63
- Stream . _isUint8Array = function _isUint8Array ( obj ) {
64
- return Object . prototype . toString . call ( obj ) === '[object Uint8Array]' ;
65
- } ;
66
- }
44
+ Stream . _isUint8Array = require ( 'internal/util/types' ) . isUint8Array ;
67
45
68
46
const version = process . version . substr ( 1 ) . split ( '.' ) ;
69
47
if ( version [ 0 ] === 0 && version [ 1 ] < 12 ) {
You can’t perform that action at this time.
0 commit comments