Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(reflection): ensure complete stripping of relative paths with mul…
…tiple leading slashes (#4844) This PR addresses an issue where relative paths with leading slashes and dots were not being stripped correctly. The problem arises when the 'path' contains multiple leading slashes like `../../`, as the current logic strips it to `/../`, which is incorrect and prevents the entity from being discovered. This code modification ensures that any dots followed by slashes are stripped to provide the full path without any dots and slashes at the beginning. **Please note:** that the current behavior is such that if you pass `./my/path` the result is `/my/path` However, with the updated code, the result will be `my/path` This change is made because, in the end, we use the resulting path to check if the `source` contains the path using `endsWith`, and the leading slash is unnecessary for this purpose. ## Update I added a slash again after @B4nan clarified a case that we need it in this [thread](https://mikroorm.slack.com/archives/CFTFEK39D/p1697634946389959?thread_ts=1697550457.817269&cid=CFTFEK39D) so the result now for `./my/path` will be `/my/path`
- Loading branch information