fix TS_RS_EXPORT_DIR

This commit is contained in:
Moritz Bischof
2024-02-16 11:10:06 +01:00
parent 4264c5f3ec
commit 83b95413a4
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -146,7 +146,8 @@ pub mod __private {
pub fn get_export_to_path<T: TS + ?Sized>() -> Option<String> {
provided_default_dir().map_or_else(
|| T::EXPORT_TO.map(ToString::to_string),
|path| Some(format!("{path}/{}.ts", T::name())),
// TODO: maybe introduce T::NAME or T::ident() or something in that vein
|path| Some(format!("{path}/{}.ts", T::name().split('<').next().unwrap())),
)
}
}
+1
View File
@@ -410,6 +410,7 @@ impl Dependency {
let exported_to = T::get_export_to()?;
Some(Dependency {
type_id: TypeId::of::<T>(),
// TODO: maybe introduce T::NAME or T::ident() or something in that vein
ts_name: T::name().split('<').next().unwrap().to_owned(),
exported_to,
})