@@ -75,6 +75,9 @@ const emittedPackageWarnings = new SafeSet();
75
75
* @param {string } base - The URL of the module that imported the package.
76
76
*/
77
77
function emitTrailingSlashPatternDeprecation ( match , pjsonUrl , base ) {
78
+ if ( process . noDeprecation ) {
79
+ return ;
80
+ }
78
81
const pjsonPath = fileURLToPath ( pjsonUrl ) ;
79
82
if ( emittedPackageWarnings . has ( pjsonPath + '|' + match ) ) { return ; }
80
83
emittedPackageWarnings . add ( pjsonPath + '|' + match ) ;
@@ -101,6 +104,9 @@ const doubleSlashRegEx = /[/\\][/\\]/;
101
104
* @param {boolean } isTarget - Whether the target is a module.
102
105
*/
103
106
function emitInvalidSegmentDeprecation ( target , request , match , pjsonUrl , internal , base , isTarget ) {
107
+ if ( process . noDeprecation ) {
108
+ return ;
109
+ }
104
110
const pjsonPath = fileURLToPath ( pjsonUrl ) ;
105
111
const double = RegExpPrototypeExec ( doubleSlashRegEx , isTarget ? target : request ) !== null ;
106
112
process . emitWarning (
@@ -123,6 +129,9 @@ function emitInvalidSegmentDeprecation(target, request, match, pjsonUrl, interna
123
129
* @param {string } [main] - The "main" field from the package.json file.
124
130
*/
125
131
function emitLegacyIndexDeprecation ( url , packageJSONUrl , base , main ) {
132
+ if ( process . noDeprecation ) {
133
+ return ;
134
+ }
126
135
const format = defaultGetFormatWithoutErrors ( url ) ;
127
136
if ( format !== 'module' ) { return ; }
128
137
const path = fileURLToPath ( url ) ;
0 commit comments