semgrep / pfff

pfff is mainly an OCaml API to write static analysis, dynamic analysis, code visualizations, code navigations, or style-preserving source-to-source transformations such as refactorings on source code.
https://semgrep.dev
Other
186 stars 29 forks source link

[TS] Translate TS type asserts to Ast_js.TypeAssert #504

Closed IagoAbal closed 2 years ago

IagoAbal commented 2 years ago

Previously we just dropped the type.

Helps returntocorp/semgrep#4515

test plan: $ cat test.ts (v8 as any) $ pfff -lang ts -dump_ts test.ts [(ExprStmt ((TypeAssert ((Id ("v8", ())), (), (TyName [("any", ())]))), ()))]

Security