Skip to content

Conversation

@Phillip9587
Copy link
Contributor

Simplified the collapseLeadingSlashes function by combining the loop condition and increment into a single line, and replaced the deprecated substr method with the more modern slice method for better compatibility.

Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is a performance improvement, but I still think it's a good change.

@rmhaiderali
Copy link
Contributor

What do you guys think of this?

function collapseLeadingSlashes(str) {
  return str.replace(/^\/+/, "/")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants