Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Nov 5, 2024
1 parent b7f8212 commit a958eb5
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,15 +663,6 @@ function createProcessingState(): ProcessingState {
declarationBuffer: null,
importTracking: createImportTrackingState(),
defaultExports: new Set(),
debug: {
exports: {
default: [],
named: [],
all: [],
},
declarations: [],
currentProcessing: '',
},
currentScope: 'top',
}
}
Expand Down Expand Up @@ -1322,7 +1313,7 @@ function processFunctionBlock(cleanDeclaration: string, state: ProcessingState):
// First check for generator functions
if (/^(?:export\s+)?(?:async\s+)?function\s*\*/.test(cleanDeclaration)) {
debugLog('block-processing', 'Processing generator function declaration')
const processed = processGeneratorFunction(cleanDeclaration, state)
const processed = processGeneratorFunction(cleanDeclaration)
if (processed) {
state.dtsLines.push(processed)
return true
Expand Down Expand Up @@ -1503,11 +1494,7 @@ function processExportBlock(cleanDeclaration: string, declarationText: string, s
}

// Log unhandled export
debugLog(
state,
'processing',
`Unhandled exported declaration type: ${cleanDeclaration.split('\n')[0]}`,
)
debugLog('processing', `Unhandled exported declaration type: ${cleanDeclaration.split('\n')[0]}`)
return true
}

Expand Down Expand Up @@ -2071,7 +2058,7 @@ function getCleanDeclaration(declaration: string): string {
return lines.slice(startIndex).join('\n').trim()
}

function processGeneratorFunction(declaration: string, state?: ProcessingState): string {
function processGeneratorFunction(declaration: string): string {
debugLog('generator-function', `Processing generator function: ${declaration}`)

// Clean up the declaration but keep info for processing
Expand Down

0 comments on commit a958eb5

Please sign in to comment.