Skip to content

Commit 7ef20b1

Browse files
chore: wip
1 parent 35c07e8 commit 7ef20b1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/dtsx/src/extractor/scanner.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,9 @@ export function scanDeclarations(_source: string, _filename: string, _keepCommen
468468
if (pos >= len) { pos = saved; return true }
469469
const nc = source.charCodeAt(pos)
470470
// Type continuation operators — NOT end of member
471-
if (nc === 124 /* | */ || nc === 38 /* & */ || nc === CH_DOT || nc === CH_QUESTION) {
471+
// `:` is the back half of a conditional/ternary (`?` is already listed); without it,
472+
// multi-branch conditional return types get truncated mid-type.
473+
if (nc === 124 /* | */ || nc === 38 /* & */ || nc === CH_DOT || nc === CH_QUESTION || nc === CH_COLON) {
472474
pos = saved; return false
473475
}
474476
// Type continuation keywords

0 commit comments

Comments
 (0)