runem / lit-analyzer

Monorepository for tools that analyze lit-html templates
MIT License
319 stars 38 forks source link

Support clutz+goog.module in nominal type check #134

Closed rictic closed 4 years ago

rictic commented 4 years ago

In the nominal type checking code for closure, we're looking for the type name by itself. However, the closure safe html types are being converted to goog.module, which after conversion with https://github.com/angular/clutz gives them type names with long prefixes. So SafeUrl becomes module$contents$goog$html$SafeUrl_SafeUrl.

This change adds a normalization function to convert the type name back to just SafeUrl for nominal type checking.

runem commented 4 years ago

Thanks for the PR! Looks great :+1: