Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor collapseLeadingSlashes function for simplicity and readability
Replaced the old implementation of collapseLeadingSlashes, which iterated over each character, with a more concise and efficient version using a regular expression. The new version uses eplace() to collapse leading slashes into a single slash and handles empty strings by returning '/'. This update improves code readability and leverages modern JavaScript string methods.
- Loading branch information