We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cccd364 commit 86c7536Copy full SHA for 86c7536
src/utils/trie.ts
@@ -87,10 +87,14 @@ export class TrieNode<T> {
87
const name = base.slice(0, dotIndex);
88
const extension = base.slice(dotIndex);
89
90
- const normalizedExtension = extension.replace(
91
- /^\.([mc])?ts(x)?$/,
92
- '.$1js$2'
93
- );
+ let normalizedExtension = extension;
+
+ if (!isDTS(extension)) {
+ normalizedExtension = extension.replace(
94
+ /\.([mc])?ts(x)?$/,
95
+ '.$1js$2'
96
+ );
97
+ }
98
99
path = dir + sep + name + normalizedExtension;
100
@@ -126,3 +130,7 @@ export class TrieNode<T> {
126
130
return aliasTrie;
127
131
}
128
132
133
134
+function isDTS(extension: string): boolean {
135
+ return /\.d(\..*)?\.[mc]?ts(x)?$/.test(extension);
136
+}
0 commit comments