From 08a090bf44384bd04756c4d05c00952ccba5256a Mon Sep 17 00:00:00 2001 From: pyob-bot Date: Thu, 28 May 2026 09:31:29 +0000 Subject: [PATCH] Refactor: Add type annotations to regex extraction results --- src/pyob/pyob_code_parser.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pyob/pyob_code_parser.py b/src/pyob/pyob_code_parser.py index 5683e0a..8343e13 100644 --- a/src/pyob/pyob_code_parser.py +++ b/src/pyob/pyob_code_parser.py @@ -79,7 +79,9 @@ def _parse_python_regex_fallback(self, code: str) -> str: return self._format_dropdowns(imports, classes, functions, consts) def _parse_javascript(self, code: str) -> str: - imports = re.findall(r"(?:import|from|require)\s+['\"].*?['\"]", code) + imports: list[str] = re.findall( + r"(?:import|from|require)\s+['\"].*?['\"]", code + ) classes = re.findall(r"(?:class|interface)\s+([a-zA-Z0-9_$]+)", code) types = re.findall(r"type\s+([a-zA-Z0-9_$]+)\s*=", code) classes.extend([f"type {t}" for t in types]) @@ -113,7 +115,7 @@ def _parse_javascript(self, code: str) -> str: ) def _parse_html(self, code: str) -> str: - scripts = re.findall(r"