Skip to content

Commit b224c26

Browse files
Change terminology from inferred to implicit
1 parent c6bafea commit b224c26

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ const leadingPathSegmentRegEx = /^(.?.[/\\])+/;
3030
const moduleInfos = {};
3131
const fileNodes = {};
3232

33-
let inferredModuleRoot;
33+
// Without explicit module ids, JSDoc will use the nearest shared ancestor directory
34+
let implicitModuleRoot;
3435

35-
function getInferredModuleRoot() {
36-
if (inferredModuleRoot) {
37-
return inferredModuleRoot;
36+
function getImplicitModuleRoot() {
37+
if (implicitModuleRoot) {
38+
return implicitModuleRoot;
3839
}
3940

40-
inferredModuleRoot = env.sourceFiles.reduce((nearestAncestor, curr, i) => {
41+
implicitModuleRoot = env.sourceFiles.reduce((nearestAncestor, curr, i) => {
4142
if (curr.startsWith(nearestAncestor) || i === 0) {
4243
return nearestAncestor;
4344
}
@@ -52,7 +53,7 @@ function getInferredModuleRoot() {
5253
}
5354
}, path.dirname(env.sourceFiles[0]));
5455

55-
return inferredModuleRoot;
56+
return implicitModuleRoot;
5657
}
5758

5859
function getModuleInfo(modulePath, parser) {
@@ -134,9 +135,9 @@ function getModuleId(modulePath) {
134135
}
135136
}
136137

137-
if (getInferredModuleRoot()) {
138+
if (getImplicitModuleRoot()) {
138139
return path
139-
.relative(inferredModuleRoot, modulePath)
140+
.relative(implicitModuleRoot, modulePath)
140141
.replace(extensionReplaceRegEx, '');
141142
}
142143

0 commit comments

Comments
 (0)