@@ -75,6 +75,9 @@ const emittedPackageWarnings = new SafeSet();
7575 * @param {string } base - The URL of the module that imported the package.
7676 */
7777function emitTrailingSlashPatternDeprecation ( match , pjsonUrl , base ) {
78+ if ( process . noDeprecation ) {
79+ return ;
80+ }
7881 const pjsonPath = fileURLToPath ( pjsonUrl ) ;
7982 if ( emittedPackageWarnings . has ( pjsonPath + '|' + match ) ) { return ; }
8083 emittedPackageWarnings . add ( pjsonPath + '|' + match ) ;
@@ -101,6 +104,9 @@ const doubleSlashRegEx = /[/\\][/\\]/;
101104 * @param {boolean } isTarget - Whether the target is a module.
102105 */
103106function emitInvalidSegmentDeprecation ( target , request , match , pjsonUrl , internal , base , isTarget ) {
107+ if ( process . noDeprecation ) {
108+ return ;
109+ }
104110 const pjsonPath = fileURLToPath ( pjsonUrl ) ;
105111 const double = RegExpPrototypeExec ( doubleSlashRegEx , isTarget ? target : request ) !== null ;
106112 process . emitWarning (
@@ -123,6 +129,9 @@ function emitInvalidSegmentDeprecation(target, request, match, pjsonUrl, interna
123129 * @param {string } [main] - The "main" field from the package.json file.
124130 */
125131function emitLegacyIndexDeprecation ( url , packageJSONUrl , base , main ) {
132+ if ( process . noDeprecation ) {
133+ return ;
134+ }
126135 const format = defaultGetFormatWithoutErrors ( url ) ;
127136 if ( format !== 'module' ) { return ; }
128137 const path = fileURLToPath ( url ) ;
0 commit comments