Skip to content

Commit

Permalink
fix TS_RS_EXPORT_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
NyxCode committed Feb 16, 2024
1 parent 4264c5f commit 83b9541
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ts-rs/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())),
)
}
}
Expand Down
1 change: 1 addition & 0 deletions ts-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit 83b9541

Please sign in to comment.