From 118de4b44c61217acbf98615388e8eb35d1b30f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Sun, 20 Nov 2022 20:43:10 +0900 Subject: [PATCH] doc: fix RESOLVE_ESM_MATCH in modules.md Return type of PACKAGE_EXPORTS_RESOLVE was changed when subpath folder mappings reached EOL. But RESOLVE_ESM_MATCH was not updated. Refs: https://github.com/nodejs/node/pull/40121 PR-URL: https://github.com/nodejs/node/pull/45280 Reviewed-By: Guy Bedford Reviewed-By: Geoffrey Booth Reviewed-By: James M Snell --- doc/api/modules.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index 2f0c8aff496b30..eb54d7921f29a3 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -272,15 +272,10 @@ LOAD_PACKAGE_SELF(X, DIR) 6. RESOLVE_ESM_MATCH(MATCH) RESOLVE_ESM_MATCH(MATCH) -1. let { RESOLVED, EXACT } = MATCH -2. let RESOLVED_PATH = fileURLToPath(RESOLVED) -3. If EXACT is true, - a. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension - format. STOP -4. Otherwise, if EXACT is false, - a. LOAD_AS_FILE(RESOLVED_PATH) - b. LOAD_AS_DIRECTORY(RESOLVED_PATH) -5. THROW "not found" +1. let RESOLVED_PATH = fileURLToPath(MATCH) +2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension + format. STOP +3. THROW "not found" ## Caching