Skip to content

Commit a378623

Browse files
committed
chore: wip
1 parent 231cf85 commit a378623

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

packages/dtsx/src/processor/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,13 @@ export function processDeclarations(
232232
allTexts.push(exp.text)
233233
}
234234

235-
// Two-phase import detection: fast includes() on combined text, then regex word-boundary check
236-
const combinedText = allTexts.join('\n')
235+
// Two-phase import detection: fast includes() rejection then regex word-boundary check
237236
for (const item of allImportedItemsMap.keys()) {
238-
if (combinedText.includes(item) && getCachedRegex(item).test(combinedText)) {
239-
usedImportItems.add(item)
237+
for (let t = 0; t < allTexts.length; t++) {
238+
if (allTexts[t].includes(item) && getCachedRegex(item).test(allTexts[t])) {
239+
usedImportItems.add(item)
240+
break
241+
}
240242
}
241243
}
242244

0 commit comments

Comments
 (0)