Skip to content

Commit

Permalink
doc: align module resolve algorithm with implementation
Browse files Browse the repository at this point in the history
Fixes: #38128

PR-URL: #38837
Reviewed-By: Guy Bedford <[email protected]>
  • Loading branch information
Ayase-252 authored and danielleadams committed Dec 16, 2021
1 parent fdbba67 commit af2f2ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ LOAD_NODE_MODULES(X, START)
NODE_MODULES_PATHS(START)
1. let PARTS = path split(START)
2. let I = count of PARTS - 1
3. let DIRS = [GLOBAL_FOLDERS]
3. let DIRS = []
4. while I >= 0,
a. if PARTS[I] = "node_modules" CONTINUE
b. DIR = path join(PARTS[0 .. I] + "node_modules")
c. DIRS = DIRS + DIR
c. DIRS = DIR + DIRS
d. let I = I - 1
5. return DIRS
5. return DIRS + GLOBAL_FOLDERS

LOAD_PACKAGE_IMPORTS(X, DIR)
1. Find the closest package scope SCOPE to DIR.
Expand Down

0 comments on commit af2f2ad

Please sign in to comment.