* Emits a deprecation warning for the use of a deprecated trailing slash pattern mapping in the "exports" field * module resolution of a package. * @param {string} match - The deprecated trailing slash pattern mapping. * @param {string} pjsonUrl - The URL of the package.json file. * @param {stri
(match, pjsonUrl, base)
| 67 | * @param {string} base - The URL of the module that imported the package. |
| 68 | */ |
| 69 | function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { |
| 70 | if (process.noDeprecation) { |
| 71 | return; |
| 72 | } |
| 73 | const pjsonPath = fileURLToPath(pjsonUrl); |
| 74 | if (emittedPackageWarnings.has(pjsonPath + '|' + match)) { return; } |
| 75 | emittedPackageWarnings.add(pjsonPath + '|' + match); |
| 76 | process.emitWarning( |
| 77 | `Use of deprecated trailing slash pattern mapping "${match}" in the ` + |
| 78 | `"exports" field module resolution of the package at ${pjsonPath}${ |
| 79 | base ? ` imported from ${fileURLToPath(base)}` : |
| 80 | ''}. Mapping specifiers ending in "/" is no longer supported.`, |
| 81 | 'DeprecationWarning', |
| 82 | 'DEP0155', |
| 83 | ); |
| 84 | } |
| 85 | |
| 86 | const doubleSlashRegEx = /[/\\][/\\]/; |
| 87 |
no test coverage detected
searching dependent graphs…