Skip to content

Instantly share code, notes, and snippets.

@sylwiaeb
Created August 4, 2015 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sylwiaeb/ccd6f76f1a414882e5dd to your computer and use it in GitHub Desktop.
Save sylwiaeb/ccd6f76f1a414882e5dd to your computer and use it in GitHub Desktop.
pretty url
prettyUrl: (url) =>
hasProtocol = url.indexOf '://'
if hasProtocol > -1
protocol = url.slice(0, hasProtocol + 3)
url = url.slice(hasProtocol + 3, url.length)
return {
protocol: protocol
url: url
}
else
{
url: url
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment