mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-16 23:43:12 +00:00
* fix(typescript): fix HOC pattern false positives and add export default HOC support Fixes two related issues from #1876: 1. False positives: `const x = arr.map(a => ...)` was incorrectly classified as a Function node. Split HOC patterns into identifier vs member_expression variants and apply a #not-any-of? blocklist for 36 array methods (map, filter, reduce, forEach, etc.) across all four query files. Runtime safety-net in tsExtractFunctionName uses a module-level ARRAY_METHODS constant (avoids per-call Set re-allocation). 2. Missing support: `export default defineEventHandler(async (e) => { ... })` and similar HOC-wrapped default exports were invisible. Added 4 export_statement patterns (TS + JS, legacy + registry-primary) and extended tsExtractFunctionName to derive the function name from the callee identifier. Now correctly distinguishes: - `const data = arr.map(account => ({...}))` → Const only (was Function+Const) - `const Button = forwardRef(...)` → Function:Button (unchanged) - `const Card = React.memo(...)` → Function:memo (unchanged) - `export default defineEventHandler(...)` → Function:defineEventHandler (new) Tests: add 2 fixture files and 4 test cases to typescript-hoc-wrapped suite covering the export default HOC positive case and array method exclusion negative case. Closes #1876 Co-authored-by: Claude <noreply@anthropic.com> AI-model: claude-sonnet-4-6 * fix(ingestion): tighten HOC callback attribution Share the TypeScript and JavaScript HOC blocklists across query and runtime paths, suppress stale array-method and built-in export-default wrappers, and derive export-default HOC names from the file instead of the wrapper helper. Also update the pinned unit and integration tests so CI reflects the new callback suppression contract. Co-authored-by: Claude <noreply@anthropic.com> AI-model: claude-sonnet-4-6 --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Gergő Magyar <gergomagyar@icloud.com> |
||
|---|---|---|
| .. | ||
| fixtures | ||
| helpers | ||
| integration | ||
| unit | ||
| utils | ||