Skip to content

Commit 85db43e

Browse files
committed
Fix incorrect path matching when calculating module specifier
1 parent 362aeab commit 85db43e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compiler/moduleSpecifiers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ namespace ts.moduleSpecifiers {
429429
startsWith(relativeToBaseUrl, prefix) &&
430430
endsWith(relativeToBaseUrl, suffix) ||
431431
!suffix && relativeToBaseUrl === removeTrailingDirectorySeparator(prefix)) {
432-
const matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length);
432+
const matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length - prefix.length);
433433
return key.replace("*", matchedStar);
434434
}
435435
}

tests/baselines/reference/tsbuild/declarationEmit/initial-build/when-declaration-file-used-inferred-type-from-referenced-project.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ exports.__esModule = true;
109109
}
110110

111111
//// [/src/packages/pkg2/lib/src/index.d.ts]
112-
export declare function fn4(): import("@fluentui/pkg1/src").IThing;
112+
export declare function fn4(): import("@fluentui/pkg1").IThing;
113113

114114

115115
//// [/src/packages/pkg2/lib/src/index.js]
@@ -139,7 +139,7 @@ exports.fn4 = fn4;
139139
},
140140
"../src/index.ts": {
141141
"version": "8515046367-import { IThings } from '@fluentui/pkg1';\nexport function fn4() {\n const a: IThings = { thing1: { a: 'b' } };\n return a.thing1;\n}",
142-
"signature": "-4446422616-export declare function fn4(): import(\"@fluentui/pkg1/src\").IThing;\r\n",
142+
"signature": "-9447422063-export declare function fn4(): import(\"@fluentui/pkg1\").IThing;\r\n",
143143
"affectsGlobalScope": false
144144
}
145145
},

0 commit comments

Comments
 (0)