{"action":"opened","issue":{"url":"https://api.github.com/repos/jfromaniello/url-join/issues/16","repository_url":"https://api.github.com/repos/jfromaniello/url-join","labels_url":"https://api.github.com/repos/jfromaniello/url-join/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/jfromaniello/url-join/issues/16/comments","events_url":"https://api.github.com/repos/jfromaniello/url-join/issues/16/events","html_url":"https://github.com/jfromaniello/url-join/issues/16","id":146398043,"number":16,"title":"v1.1.0 doesn't de-dupe \"/\" in relative URLs","user":{"login":"tivac","id":49545,"avatar_url":"https://avatars.githubusercontent.com/u/49545?v=3","gravatar_id":"","url":"https://api.github.com/users/tivac","html_url":"https://github.com/tivac","followers_url":"https://api.github.com/users/tivac/followers","following_url":"https://api.github.com/users/tivac/following{/other_user}","gists_url":"https://api.github.com/users/tivac/gists{/gist_id}","starred_url":"https://api.github.com/users/tivac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tivac/subscriptions","organizations_url":"https://api.github.com/users/tivac/orgs","repos_url":"https://api.github.com/users/tivac/repos","events_url":"https://api.github.com/users/tivac/events{/privacy}","received_events_url":"https://api.github.com/users/tivac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-06T18:33:52Z","updated_at":"2016-04-06T18:33:52Z","closed_at":null,"body":"It looks like the `/` deduping regex changed after `v0.0.1`\r\n\r\n```js\r\n// v0.0.1\r\n.replace(/[\\/]+/g, '/')\r\n\r\n// v1.1.0\r\n.replace(/([^:\\s])\\/+/g, '$1/')\r\n```\r\n\r\nwhich means that relative URLs now don't correctly dedupe leading repeat `/`.\r\n\r\n```js\r\n// v0.0.1\r\n> join(\"/\", \"/\");\r\n> \"/\"\r\n\r\n// v1.1.0\r\n> join(\"/\", \"/\");\r\n> \"//\"\r\n```\r\n\r\nI can work around it in my own code but if this is only intended to support absolute URLs that may be worth calling out.\r\n\r\nAlternatively an option (added via the system introduced in #14) to specify if the URL is intended to be relative and use the older regex may be worthwhile. Thoughts? I can send a PR if you'd like.\r\n"}}