From 7216fb118df228699457a5510646bf2b61a9ca88 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Wed, 8 Sep 2021 10:36:52 -0700 Subject: module: deprecate trailing slash pattern mappings PR-URL: https://github.com/nodejs/node/pull/40039 Reviewed-By: Antoine du Hamel Reviewed-By: Geoffrey Booth --- doc/api/deprecations.md | 14 ++++++++++++++ doc/api/esm.md | 2 ++ 2 files changed, 16 insertions(+) (limited to 'doc/api') diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index aa4d0d024a4..e25e855c085 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2814,6 +2814,20 @@ Type: Documentation-only (supports [`--pending-deprecation`][]) The `'hash'` and `'mgf1Hash'` options are replaced with `'hashAlgorithm'` and `'mgf1HashAlgorithm'`. +### DEP0155: Trailing slashes in pattern specifier resolutions + + +Type: Documentation-only (supports [`--pending-deprecation`][]) + +The remapping of specifiers ending in `"/"` like `import 'pkg/x/'` is deprecated +for package `"exports"` and `"imports"` pattern resolutions. + [Legacy URL API]: url.md#legacy-url-api [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 diff --git a/doc/api/esm.md b/doc/api/esm.md index 9d7792441ca..a3aa832e7c8 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -1205,6 +1205,8 @@ _isImports_, _conditions_) > _expansionKey_ up to but excluding the first _"*"_ character. > 1. If _patternBase_ is not **null** and _matchKey_ starts with but is not > equal to _patternBase_, then +> 1. If _matchKey_ ends with _"/"_, throw an _Invalid Module Specifier_ +> error. > 1. Let _patternTrailer_ be the substring of _expansionKey_ from the > index after the first _"*"_ character. > 1. If _patternTrailer_ has zero length, or if _matchKey_ ends with -- cgit v1.2.3