Aleph-Alpha / ts-rs

Generate TypeScript bindings from Rust types
MIT License
989 stars 99 forks source link

bug: Fix issue with absolute paths #323

Closed escritorio-gustavo closed 1 month ago

escritorio-gustavo commented 1 month ago

Goal

Remove the absolute path check that tricks the absolute function Closes #322 Closes #325

Changes

Removed an if statement in the absolute function that would returned the unaltered path

Checklist

escritorio-gustavo commented 1 month ago

Could we come up with some tests (or at least one for the linked issue)?

I've added a CI test to trigger the incorrect behavior by running TS_RS_EXPORT_DIR=$(pwd)/output cargo test --no-default-features. The use of pwd makes the path_bug test break

NyxCode commented 1 month ago

Awesome, thanks! Feel free to merge!