Skip to content

Commit 86600c1

Browse files
Add comment
1 parent ac42000 commit 86600c1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/core/extractors.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ function collectNodesByType(node: Node, type: string, results: Node[]): void {
3333
}
3434
}
3535

36+
/**
37+
* Collects string variable assignments from the AST for path resolution.
38+
* Only resolves simple assignments (e.g. `WEBHOOK_PATH = "/webhook"`).
39+
*
40+
* Examples:
41+
* WEBHOOK_PATH = "/webhook" -> Map { "WEBHOOK_PATH" => "/webhook" }
42+
* BASE = "/api" -> Map { "BASE" => "/api" }
43+
* settings.PREFIX = "/api" -> (skipped, not a simple identifier)
44+
*/
3645
export function collectStringVariables(rootNode: Node): Map<string, string> {
3746
const variables = new Map<string, string>()
3847
const assignmentNodes = findNodesByType(rootNode, "assignment")

0 commit comments

Comments
 (0)