Skip to content

Commit 7e3207f

Browse files
committed
chore: wip
1 parent 9497d6f commit 7e3207f

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

src/extract.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable regexp/no-super-linear-backtracking */
1+
/* eslint-disable regexp/no-super-linear-backtracking, no-console, no-cond-assign */
22

33
/**
44
* Regular expression patterns used throughout the module
@@ -191,10 +191,6 @@ export interface FunctionSignature {
191191
generics: string
192192
}
193193

194-
// ===========================
195-
// Core Functions
196-
// ===========================
197-
198194
/**
199195
* Creates initial processing state with empty collections
200196
*/
@@ -1530,7 +1526,7 @@ function splitObjectProperties(content: string): string[] {
15301526
*/
15311527
function trackUsedTypes(content: string, usedTypes: Set<string>): void {
15321528
let match: any
1533-
// eslint-disable-next-line no-cond-assign
1529+
15341530
while ((match = REGEX.typePattern.exec(content)) !== null) {
15351531
const type = match[1] || match[2]
15361532
if (type) {
@@ -1558,7 +1554,7 @@ function trackTypeUsage(content: string, state: ImportTrackingState): void {
15581554
// Only look for capitalized type references that are actually used in declarations
15591555
const typePattern = /(?:extends|implements|:|<)\s*([A-Z][a-zA-Z0-9]*(?:<[^>]+>)?)/g
15601556
let match
1561-
// eslint-disable-next-line no-cond-assign
1557+
15621558
while ((match = typePattern.exec(content)) !== null) {
15631559
const typeName = match[1].split('<')[0] // Handle generic types
15641560
state.usedTypes.add(typeName)
@@ -1581,7 +1577,6 @@ function trackValueUsage(content: string, state: ImportTrackingState, dtsLines?:
15811577

15821578
for (const pattern of patterns) {
15831579
let match
1584-
// eslint-disable-next-line no-cond-assign
15851580
while ((match = pattern.exec(content)) !== null) {
15861581
const values = match[1].split(',').map(v => v.trim())
15871582
for (const value of values) {
@@ -1647,7 +1642,6 @@ function formatOutput(state: ProcessingState): string {
16471642
debugLog(state, 'output', `Adding ${currentSection.length} declarations`)
16481643
parts.push(currentSection.join('\n'))
16491644
}
1650-
16511645
// Deduplicate and add export statements
16521646
const exportLines = new Set([
16531647
...state.dtsLines.filter(isExportStatement),

0 commit comments

Comments
 (0)