Skip to main content

strip_types

Function strip_types 

pub fn strip_types(source: &str, filename: &str) -> Result<String, StripError>
Expand description

Strip TypeScript types from source, returning equivalent JavaScript.

filename selects the source flavour (.ts/.tsx/.mts) and labels diagnostics; it does not have to exist on disk. Value imports are preserved verbatim (see the module docs); only type syntax is erased.