Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

use a regex to find the first non-host character #3

Closed
wants to merge 1 commit into from

Conversation

jackwanders
Copy link

I was looking into how your url package parsed URLs, and I thought I'd suggest a more compact way to find the index of the first non-host character.

While not super-important, here's a jsperf of the two methods: http://jsperf.com/loop-vs-regex-for-node-url-parse

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant