File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
'use strict' ;
4
4
5
- const { emitWarning } = require ( 'node: process' ) ;
5
+ const { emitWarning } = require ( 'process' ) ;
6
6
var url = require ( 'url' ) ;
7
7
var sprintf = require ( 'util' ) . format ;
8
8
@@ -846,12 +846,16 @@ function patch(Request) {
846
846
* @function closed
847
847
* @returns {Boolean } is closed
848
848
*/
849
+ let closedDeprecatedWarned = false ;
849
850
Request . prototype . closed = function closed ( ) {
850
- emitWarning (
851
- 'restify req.closed is deprecated, will be removed on Restify 10' ,
852
- 'RestifyDeprecationWarning' ,
853
- 'RestifyDEPReqClosed'
854
- ) ;
851
+ if ( ! closedDeprecatedWarned ) {
852
+ emitWarning (
853
+ 'restify req.closed is deprecated, will be removed on v10' ,
854
+ 'RestifyDeprecationWarning' ,
855
+ 'RestifyDEPReqClosed'
856
+ ) ;
857
+ closedDeprecatedWarned = true ;
858
+ }
855
859
var self = this ;
856
860
return self . connectionState ( ) === 'close' ;
857
861
} ;
You can’t perform that action at this time.
0 commit comments