@@ -35,6 +35,7 @@ const {
35
35
getColorDepth,
36
36
hasColors
37
37
} = require ( 'internal/tty' ) ;
38
+ const { deprecate } = require ( 'internal/util' ) ;
38
39
39
40
// Lazy loaded for startup performance.
40
41
let readline ;
@@ -119,9 +120,17 @@ ObjectSetPrototypeOf(WriteStream, net.Socket);
119
120
120
121
WriteStream . prototype . isTTY = true ;
121
122
122
- WriteStream . prototype . getColorDepth = getColorDepth ;
123
+ WriteStream . prototype . getColorDepth = deprecate (
124
+ getColorDepth ,
125
+ 'tty.WriteStream.getColorDepth is deprecated. ' +
126
+ 'Please use tty.getColorDepth instead.' ,
127
+ 'DEP0156' ) ;
123
128
124
- WriteStream . prototype . hasColors = hasColors ;
129
+ WriteStream . prototype . hasColors = deprecate (
130
+ hasColors ,
131
+ 'tty.WriteStream.hasColors is deprecated. ' +
132
+ 'Please use tty.hasColors instead.' ,
133
+ 'DEP0157' ) ;
125
134
126
135
WriteStream . prototype . _refreshSize = function ( ) {
127
136
const oldCols = this . columns ;
@@ -161,4 +170,4 @@ WriteStream.prototype.getWindowSize = function() {
161
170
return [ this . columns , this . rows ] ;
162
171
} ;
163
172
164
- module . exports = { isatty, ReadStream, WriteStream } ;
173
+ module . exports = { isatty, getColorDepth , hasColors , ReadStream, WriteStream } ;
0 commit comments