Created
December 17, 2017 01:17
-
-
Save banyudu/4b33b674521dea6b1a6e6d705b7fd9f0 to your computer and use it in GitHub Desktop.
Extracts origin from url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const extractOriginFromFullUrl = url => url.split('/', 3).join('/') | |
extractOriginFromFullUrl('http://www.example.com:8080/abc') // => http://www.example.com:8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment