MCPcopy Index your code
hub / github.com/nodejs/node / emitTrailingSlashPatternDeprecation

Function emitTrailingSlashPatternDeprecation

lib/internal/modules/esm/resolve.js:69–84  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

67 * @param {string} base - The URL of the module that imported the package.
68 */
69function 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
86const doubleSlashRegEx = /[/\\][/\\]/;
87

Callers 1

packageExportsResolveFunction · 0.85

Calls 3

fileURLToPathFunction · 0.85
hasMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…